Text topic segmentation method and system, computer equipment and storage medium
The method enhances the accuracy and reliability of text topic segmentation by using a pre-trained Transformer model with a learnable weight matrix to adjust sentence embeddings and input them into a classifier, addressing the model's lack of local context sensitivity and improving interpretability.
Patent Information
- Application Number
- CN202411168567.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
The Transformer model excels in capturing global information but lacks sensitivity to local context, affecting the accuracy and interpretability of text topic segmentation, which is crucial for understanding sentence semantics and dividing topic boundaries.
A text topic segmentation method that utilizes a pre-trained Transformer model to generate sentence embeddings, applies a self-attention mechanism and a learnable weight matrix to adjust these embeddings, and inputs them into a classifier to generate topic boundary information, thereby enhancing local context capture and interpretability.
The method improves the accuracy and reliability of text topic segmentation by emphasizing local context and providing interpretable results, suitable for applications in news media, market research, social media analysis, and customer feedback analysis.
Smart Images

Figure CN119129585A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology and is applied to financial-related intelligent customer service scenarios, and specifically relates to a text topic segmentation method, system, computer equipment, and non-volatile computer-readable storage medium. Background Art
[0002] At present, as a basic task in natural language processing (NLP), text topic segmentation has the core goal of dividing the text into coherent paragraphs according to the different topics discussed therein. Traditional topic segmentation methods mainly rely on local context analysis and language feature extraction, such as using part-of-speech tagging, syntactic structure, and local semantic features to identify the topic boundaries of the text. Currently, with the development of deep learning, especially the introduction of the Transformer model, the field of text topic segmentation has ushered in new development opportunities. The Transformer model can capture the complex relationship between word embeddings in the text through the self-attention mechanism, no matter how far apart these words are in the text. This global dependency capture ability enables the Transformer model to achieve significant performance improvements in many NLP tasks.
[0003] However, although the Transformer model performs well in capturing global information, the opacity of its internal working mechanism (often referred to as the "black box" problem) and the lack of capturing local context information pose challenges to text topic segmentation. Local context information is crucial for understanding sentence semantics and accurately dividing topic boundaries, but the Transformer model does not perform well in this regard. That is, the shortcomings of the existing technology are:
[0004] 1. Although the Transformer model has advantages in capturing global information, it lacks sensitivity to local context, which affects the accuracy of text topic segmentation;
[0005] 2. The Transformer model is not sufficiently interpretable, which makes it difficult to meet the requirements for transparency and reliability in practical applications.
[0006] In summary, how to provide a text topic segmentation method, system, computer device and non-volatile computer-readable storage medium that can effectively improve the accuracy and reliability of text topic segmentation is a problem that needs to be urgently solved by those skilled in the art. Summary of the invention
[0007] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a text topic segmentation method, system, computer device and non-volatile computer-readable storage medium that can be used in financial technology or other related fields, aiming to solve the problem of how to effectively improve the accuracy and reliability of text topic segmentation.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A text topic segmentation method, comprising:
[0010] Use the pre-trained Transformer model to embed the target text and generate multiple sentence embeddings;
[0011] Based on the sentence embeddings, a corresponding target weight matrix is generated using a preset self-attention mechanism and a learnable weight matrix calculation process;
[0012] Using the target weight matrix to adjust and process each of the sentence embeddings to generate a corresponding sentence embedding representation;
[0013] Embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text;
[0014] Based on the topic boundary information, the target text is segmented into topics.
[0015] In a further technical solution, the text topic segmentation method, wherein the pre-trained Transformer model is used to embed the target text to generate multiple sentence embeddings, including:
[0016] Get the uploaded text to be segmented;
[0017] Preprocessing the text to be segmented to generate corresponding target text;
[0018] The target text is embedded using a pre-trained Transformer model to generate multiple sentence embeddings.
[0019] In a further technical solution, the text topic segmentation method, wherein the method generates a corresponding target weight matrix based on the embedding of each sentence using a preset self-attention mechanism and a learnable weight matrix calculation process, comprises:
[0020] Calculate the attention scores between the sentence embeddings using a preset self-attention mechanism to generate a corresponding self-attention matrix;
[0021] Based on the self-attention matrix and the preset learnable weight matrix, a corresponding target weight matrix is generated.
[0022] In a further technical solution, the text topic segmentation method, wherein the use of the target weight matrix to adjust and process each of the sentence embeddings to generate corresponding sentence embedding representations, includes:
[0023] Using the target weight matrix to perform preliminary adjustment processing on each of the sentence embeddings to generate corresponding initial sentence embeddings;
[0024] Each of the initial sentence embeddings is evaluated and optimized to generate a corresponding sentence embedding representation.
[0025] In a further technical solution, the text topic segmentation method, wherein the embedding of each sentence into a representation input classifier to generate topic boundary information of the target text, comprises:
[0026] Pre-build the classifiers required for text topic segmentation;
[0027] Inputting each of the sentence embedding representations into the classifier;
[0028] Receive a topic prediction result of the target text returned by the classifier; wherein the topic prediction result includes topic boundary information and topic labels of the target text.
[0029] In a further technical solution, the text topic segmentation method, wherein the topic segmentation of the target text based on the topic boundary information includes:
[0030] Based on the topic boundary information, the target text is topic-segmented to obtain a plurality of corresponding target topics;
[0031] A corresponding target tag is configured for each target topic through the topic tag.
[0032] In a further technical solution, the text topic segmentation method, wherein the corresponding target weight matrix is generated based on the self-attention matrix and the preset learnable weight matrix, comprises:
[0033] Pre-built learnable weight matrices;
[0034] The self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix.
[0035] A text topic segmentation system, comprising:
[0036] The embedding processing module is used to embed the target text using the pre-trained Transformer model to generate multiple sentence embeddings;
[0037] A calculation processing module, used for generating a corresponding target weight matrix based on the sentence embeddings using a preset self-attention mechanism and a learnable weight matrix calculation processing;
[0038] An adjustment processing module, used to adjust and process each of the sentence embeddings using the target weight matrix to generate a corresponding sentence embedding representation;
[0039] An information generation module, used for embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text;
[0040] The topic segmentation module is used to perform topic segmentation on the target text based on the topic boundary information.
[0041] A computer device, wherein the computer device comprises at least one processor; and
[0042] a memory communicatively connected to the at least one processor; wherein,
[0043] The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the text topic segmentation method as described in any one of the above items can be implemented.
[0044] A non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the text topic segmentation method as described in any one of the above items can be implemented.
[0045] Compared with the prior art, the present invention provides a text topic segmentation method, system, computer device and non-volatile computer-readable storage medium, wherein the method comprises: using a pre-trained Transformer model to embed the target text and generate multiple sentence embeddings; based on each of the sentence embeddings, using a preset self-attention mechanism and a learnable weight matrix to calculate and process, generating a corresponding target weight matrix; using the target weight matrix to adjust and process each of the sentence embeddings and generate a corresponding sentence embedding representation; inputting each of the sentence embedding representations into a classifier to generate the topic boundary information of the target text; based on the topic boundary information, the target text is subject-segmented. In this way, the accuracy and reliability of text topic segmentation can be effectively improved by the method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flowchart of a text topic segmentation method provided by an embodiment of the present invention.
[0048] Figure 2 for Figure 1 Schematic diagram of the process of step S100 described in .
[0049] Figure 3 for Figure 1 Schematic diagram of the process of step S200 described in .
[0050] Figure 4 for Figure 1 Schematic diagram of the process of step S300 described in .
[0051] Figure 5 for Figure 1 Schematic diagram of the process of step S400 described in .
[0052] Figure 6 for Figure 1 Schematic diagram of the process of step S500 described in .
[0053] Figure 7 A schematic diagram of functional modules of a text topic segmentation system provided in an embodiment of the present invention.
[0054] Figure 8 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0056] In the description of the present invention, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.
[0057] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0058] See also Figure 1 The embodiment of the present invention provides a text topic segmentation method, wherein the method comprises the steps of:
[0059] S100, use the pre-trained Transformer model to embed the target text and generate multiple sentence embeddings;
[0060] S200, based on the sentence embedding, using a preset self-attention mechanism and a learnable weight matrix calculation process to generate a corresponding target weight matrix;
[0061] S300, using the target weight matrix to adjust and process each of the sentence embeddings to generate a corresponding sentence embedding representation;
[0062] S400, embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text;
[0063] S500: Based on the topic boundary information, the target text is segmented into topics.
[0064] For further information, see Figure 2 , the text topic segmentation method, wherein the step S100, using the pre-trained Transformer model to embed the target text to generate multiple sentence embeddings, specifically includes the steps of:
[0065] S101, obtaining the uploaded text to be segmented;
[0066] S102, preprocessing the text to be segmented to generate a corresponding target text;
[0067] S103. Embed the target text using a pre-trained Transformer model to generate multiple sentence embeddings.
[0068] Specifically in implementation, in this embodiment, obtain the uploaded text to be segmented; preprocess the text to be segmented to generate the corresponding target text; embed the target text using a pre-trained Transformer model to generate multiple sentence embeddings; among them, the specific implementation process is roughly as follows:
[0069] 1) Obtain the uploaded text to be segmented
[0070] Input reception: Create a user interface or API endpoint that allows users to upload text files or directly paste text content;
[0071] Format support: Ensure that it can receive and process multiple text formats, such as TXT, PDF, Word documents, etc.;
[0072] Storage: Save the uploaded text to be segmented on the server or local storage device for subsequent processing;
[0073] 2) Preprocess to generate the target text
[0074] Text cleaning: Remove irrelevant content in the text, such as special characters, advertisements, footers, etc.;
[0075] Sentence splitting: Split the text into sentences or paragraphs for easy model processing;
[0076] Word segmentation: Segment each sentence to convert continuous text into discrete lexical units;
[0077] Stop word removal: Delete common words that contribute little to the analysis, such as "de" (of), "shi" (is), etc.;
[0078] Part-of-speech tagging (optional): Perform part-of-speech tagging on the word segmentation results to provide syntactic information for the model;
[0079] 3) Use the Transformer model for embedding processing
[0080] Load the pre-trained model: Select a pre-trained Transformer model, such as BERT or GPT, and load it into memory;
[0081] Text conversion: Convert the target text into a format acceptable to the Transformer model, including constructing the input sequence, adding special tokens (such as [CLS], [SEP]), etc.;
[0082] Generate sentence embeddings: Input the transformed text into the Transformer model to obtain the embedding representation of each sentence; this usually involves the output of the previous layer of the model, that is, the hidden state of the last layer;
[0083] Embedding aggregation (optional): For longer text paragraphs, aggregation strategies (such as average pooling) can be used to generate paragraph or document-level embeddings;
[0084] 4) Post-processing of sentence embeddings (optional)
[0085] Normalization: Normalize the generated sentence embeddings to eliminate scale differences between different dimensions;
[0086] Dimensionality reduction: If the embedding dimension is too high, PCA or other dimensionality reduction techniques can be used to reduce the embedding dimension while retaining important information as much as possible;
[0087] Through the above process, the complete flow from text uploading to generating sentence embeddings can be realized, laying the foundation for subsequent topic segmentation tasks.
[0088] For further information, see Figure 3 , the text topic segmentation method, wherein the step S200, based on the embedding of each of the sentences, uses a preset self-attention mechanism and a learnable weight matrix calculation process to generate a corresponding target weight matrix, specifically comprising the steps of:
[0089] S201, using a preset self-attention mechanism to calculate the attention score between the sentence embeddings and generate a corresponding self-attention matrix;
[0090] S202. Generate a corresponding target weight matrix based on the self-attention matrix and the preset learnable weight matrix.
[0091] Furthermore, the text topic segmentation method, wherein the step S202, generating a corresponding target weight matrix based on the self-attention matrix and the preset learnable weight matrix, specifically includes:
[0092] Pre-built learnable weight matrices;
[0093] The self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix.
[0094] In the specific implementation, in this embodiment, the preset self-attention mechanism is used to calculate the attention scores between the sentence embeddings to generate a corresponding self-attention matrix; a learnable weight matrix is pre-constructed; the self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix; wherein the specific implementation process is roughly as follows:
[0095] 1) Initialize the self-attention mechanism
[0096] Configure self-attention parameters: Set the parameters required for the self-attention mechanism, including the number of heads, scaling factor, etc.
[0097] Generate Q, K, V vectors: Use the sentence embedding of the target text to generate query (Q), key (K), and value (V) vectors through a learnable linear transformation;
[0098] 2) Calculate the attention score
[0099] Calculate the attention weights: Calculate the dot product with the Q and K vectors, then apply the scaling factor and softmax function to obtain the normalized attention weights;
[0100] Generate self-attention matrix: multiply the attention weight by the V vector to get the weighted value vector, and then sum these vectors to form the self-attention matrix; this matrix reflects the correlation between sentences;
[0101] 3) Post-processing of the self-attention matrix (optional)
[0102] Recalibration: Recalibrate or normalize the self-attention matrix as needed to emphasize or suppress the relationship between certain sentences;
[0103] 4) Define and apply a learnable weight matrix
[0104] Initialize the weight matrix: Create a learnable weight matrix that has the ability to adjust according to the specific sentence context; in particular, the weight of each row must obey a normal distribution centered on the sentence embedding of that row; the purpose of this is to force each sentence embedding to pay more attention to the local information around it, rather than the information far away from its context;
[0105] Multiplication calculation: Multiply the self-attention matrix by the learnable weight matrix to generate the target weight matrix; this matrix combines the attention scores between sentences and the importance of the sentence context, which can better reflect the actual relevance between sentences;
[0106] Through the above process, we can make full use of the self-attention mechanism to capture the complex relationships between sentences, and effectively adjust and optimize these relationships through the learnable weight matrix to improve the performance of text topic segmentation.
[0107] For further information, see Figure 4 , the text topic segmentation method, wherein the step S300, using the target weight matrix to adjust and process each of the sentence embeddings to generate a corresponding sentence embedding representation, specifically includes the steps of:
[0108] S301, using the target weight matrix to perform preliminary adjustment processing on each of the sentence embeddings to generate corresponding initial sentence embeddings;
[0109] S302: Evaluate and optimize each of the initial sentence embeddings to generate a corresponding sentence embedding representation.
[0110] In the specific implementation, in this embodiment, the target weight matrix is used to perform preliminary adjustment processing on each of the sentence embeddings to generate a corresponding initial sentence embedding; each of the initial sentence embeddings is evaluated and optimized to generate a corresponding sentence embedding representation; wherein the specific implementation process is roughly as follows:
[0111] 1) Apply the target weight matrix for preliminary adjustment
[0112] Load the target weight matrix: Apply the target weight matrix to each sentence embedding, preparing to adjust each sentence embedding;
[0113] Weighted sentence embedding: multiply the embedding vector of each sentence by the target weight matrix, make preliminary adjustments, and generate the corresponding initial sentence embedding;
[0114] 2) Forming an initial sentence embedding set
[0115] Collect results: Collect all the preliminarily adjusted sentence embeddings to form an initial sentence embedding set;
[0116] Standardization: Standardize the initial sentence embedding set to ensure that the vectors have a uniform scale for subsequent processing;
[0117] 3) Evaluate the quality of initial sentence embeddings
[0118] Define evaluation criteria: Determine the metric to evaluate the initial sentence embeddings, such as consistency, discrimination, or relevance to known topic labels;
[0119] Perform evaluation: Score each initial sentence embedding using evaluation metrics to identify possible issues or deficiencies;
[0120] 4) Optimize initial sentence embedding
[0121] Apply optimization algorithms: Based on the evaluation results, select appropriate optimization algorithms to adjust each initial sentence embedding, such as gradient descent, regularization methods, or feature selection;
[0122] Iterative adjustment: The initial sentence embedding is continuously optimized through an iterative process until the preset stopping condition or performance indicator is met;
[0123] 5) Generate the final sentence embedding representation
[0124] Extract optimization results: Extract the final adjusted sentence embeddings from the optimization process, which should now better capture the semantic and contextual information of the text;
[0125] Generate embedding representations: Use the optimized sentence embeddings as the final sentence embedding representations, which will be used as input for topic segmentation or other downstream tasks;
[0126] Through the above process, we can ensure that the sentence embedding not only contains rich semantic information of the text, but also has been carefully adjusted and optimized to meet the needs of specific tasks.
[0127] For further information, see Figure 5 , the text topic segmentation method, wherein the step S400, embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text, specifically comprises the steps of:
[0128] S401, pre-building a classifier required for text topic segmentation;
[0129] S402, inputting each sentence embedding representation into the classifier;
[0130] S403, receiving the topic prediction result of the target text returned by the classifier; wherein the topic prediction result includes topic boundary information and topic labels of the target text.
[0131] In the specific implementation, in this embodiment, a classifier required for text topic segmentation is pre-built; each sentence embedding representation is input into the classifier; the topic prediction result of the target text returned by the classifier is received; wherein the topic prediction result includes the topic boundary information and topic label of the target text; wherein the specific implementation process is roughly as follows:
[0132] 1) Build a classifier
[0133] Select model architecture: According to the needs of text topic segmentation, choose a suitable classifier architecture, such as support vector machine (SVM), random forest, neural network, etc.;
[0134] Prepare training data: Collect and label the data used to train the classifier, including text and its corresponding topic boundaries and topic labels;
[0135] Train the classifier: Use the prepared data to train the classifier and adjust the model parameters until the classifier achieves the expected performance;
[0136] 2) Input sentence embedding representation to the classifier
[0137] Formatting input: Converting each sentence embedding representation into a format suitable for classifier input, which may include serialization or reshaping operations;
[0138] Input embedding: Input the embedding representation of each sentence into the pre-trained classifier to prepare for topic prediction;
[0139] 3) Perform topic prediction
[0140] Classifier reasoning: The classifier processes the input sentence embedding representation and infers the topic boundaries and topic labels in the target text;
[0141] Generate prediction results: The classifier outputs the topic prediction for each sentence or paragraph, including the location of the topic boundary and the corresponding topic label;
[0142] 4) Receive and process topic prediction results
[0143] Capture output: Receive the topic prediction results returned by the classifier, including topic boundary information and topic labels;
[0144] Result integration: Integrate the topic prediction results into an easy-to-understand format, such as matching boundary information and labels with the original target text;
[0145] Through the above process, the complete flow from sentence embedding representation to topic prediction results can be realized, providing users with an automated solution for text topic segmentation.
[0146] For further information, see Figure 6 , the text topic segmentation method, wherein the step S500, based on the topic boundary information, performs topic segmentation on the target text, specifically comprises the steps of:
[0147] S501, based on the topic boundary information, subject-segment the target text to obtain corresponding multiple target topics;
[0148] S502: configuring a corresponding target tag for each target topic through the topic tag.
[0149] In the specific implementation, in this embodiment, based on the topic boundary information, the target text is topic-segmented to obtain a plurality of corresponding target topics; a corresponding target tag is configured for each target topic through the topic tag; wherein the specific implementation process is roughly as follows:
[0150] 1) Determine the topic boundaries
[0151] Parsing topic boundary information: Based on the output provided by the classifier, identify the start and end boundaries of each topic in the target text;
[0152] Boundary marking: clearly mark these boundaries in the target text to prepare for subsequent segmentation;
[0153] 2) Perform text segmentation
[0154] Segment text: Segment the target text into multiple independent topic blocks (target topics) based on the determined topic boundaries;
[0155] Storing topics: Each segmented topic block is stored as a separate text unit for further processing;
[0156] 3) Assign topic tags
[0157] Matching labels: Matching the topic labels predicted by the classifier with the corresponding text topic chunks;
[0158] Label themes: Ensure each topic block is assigned a clear topic label for easy identification and classification;
[0159] 4)Optimize theme consistency (optional)
[0160] Review overlaps: Check if there are any overlaps or ambiguities in the content of the segmented topic blocks;
[0161] Adjust boundaries: Adjust topic boundaries as needed to improve topic consistency and readability;
[0162] 5) Generate the final topic segmentation results
[0163] Organize the results: Organize the segmented topic blocks and their topic labels into a format that is easy to understand and use;
[0164] Output results: Output the final topic segmentation results, including the specific content and corresponding labels of each topic in the target text;
[0165] Through the above process, the target text can be effectively segmented into multiple target topics, and a suitable target label can be assigned to each target topic, thereby achieving the structuring of text content and the orderly organization of information.
[0166] It can be seen from the above method embodiments that the text topic segmentation method provided by the present invention at least includes: using a pre-trained Transformer model to embed the target text to generate multiple sentence embeddings; based on each of the sentence embeddings, using a preset self-attention mechanism and a learnable weight matrix to calculate and process, generating a corresponding target weight matrix; using the target weight matrix to adjust and process each of the sentence embeddings to generate a corresponding sentence embedding representation; inputting each of the sentence embedding representations into a classifier to generate the topic boundary information of the target text; based on the topic boundary information, performing topic segmentation on the target text; and so on. In this way, the accuracy and reliability of text topic segmentation can be effectively improved by the method of the present invention.
[0167] Specifically, the text topic segmentation method provided by the embodiment of the present invention can at least achieve the following beneficial technical effects:
[0168] 1. Enhanced interpretability: The method of the present invention can enhance the interpretability of text topic segmentation. By adjusting the attention mode, the importance of sentences in different contexts can be dynamically adjusted. Such a mechanism makes the output attention distribution more interpretable, which can help users understand the basis for judging the relationship between sentences and improve the transparency and reliability of text topic segmentation.
[0169] 2. Improved local context capture: The method of the present invention aims to emphasize the local relationship between sentences, and can better capture and utilize the local context information of sentences; this ability to focus on local context is very important for the text topic segmentation task, because it enables the method of the present invention to more accurately divide the topic boundaries and improve the accuracy of segmentation;
[0170] 3. Improve accuracy and efficiency: By constraining the attention scores of the self-attention matrix to follow a specific distribution, the method of the present invention can better adapt to the dialogue scenario and improve the accuracy of the text topic segmentation task; at the same time, the method of the present invention does not require large-scale architectural changes and can achieve efficient component integration and rapid deployment;
[0171] 4. Practical application value: Text topic segmentation is widely used in many industries, including news media, market research, social media analysis and customer feedback analysis; the application of the method of the present invention can improve the application effect of enterprises in the fields of information organization, content summarization, sentiment analysis, targeted advertising and intelligent customer service, which will provide more accurate and efficient data processing and decision support for related industries;
[0172] 5. Scalability and adaptability: The application of the method of the present invention is highly flexible and adaptable, and can be customized and optimized according to specific tasks and needs, which enables researchers and practitioners to freely choose a topic segmentation method that suits them according to actual conditions;
[0173] The method of the present invention can effectively overcome the limitations of the traditional Transformer model in the topic segmentation task and obtain better interpretability, local context capture, accuracy and practical application value, which can provide new development directions and opportunities for research and practical applications related to topic segmentation.
[0174] It should be understood that, although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the embodiment or flowchart. The order of steps listed in the embodiment or flowchart is only one way of executing the order of many steps, and does not represent the only execution order. It should be noted that there is not necessarily a certain order between the above steps. A person of ordinary skill in the art can understand from the description of the embodiment of the present invention that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or they may be executed in exchange, etc. Moreover, at least a part of the steps in the embodiment or flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be executed in turn, alternately or synchronously with other steps or at least a part of the sub-steps or stages of other steps.
[0175] Based on the above method embodiment, please refer to Figure 7 Another embodiment of the present invention further provides a text topic segmentation system, wherein the system comprises:
[0176] An embedding processing module 11 is used to embed the target text using a pre-trained Transformer model to generate multiple sentence embeddings;
[0177] A calculation processing module 12 is used to generate a corresponding target weight matrix based on the sentence embeddings using a preset self-attention mechanism and a learnable weight matrix calculation process;
[0178] An adjustment processing module 13 is used to adjust and process each of the sentence embeddings using the target weight matrix to generate a corresponding sentence embedding representation;
[0179] An information generation module 14 is used to embed each of the sentences into a representation input classifier to generate topic boundary information of the target text;
[0180] The topic segmentation module 15 is used to perform topic segmentation on the target text based on the topic boundary information.
[0181] Further, for the text topic segmentation system described above, the step of using a pre-trained Transformer model to perform embedding processing on the target text to generate multiple sentence embeddings specifically includes:
[0182] Obtain the uploaded text to be segmented;
[0183] Preprocess the text to be segmented to generate the corresponding target text;
[0184] Use a pre-trained Transformer model to perform embedding processing on the target text to generate multiple sentence embeddings.
[0185] In specific implementation, in this embodiment, the uploaded text to be segmented is obtained; the text to be segmented is preprocessed to generate the corresponding target text; a pre-trained Transformer model is used to perform embedding processing on the target text to generate multiple sentence embeddings; specifically, the implementation process is roughly as follows:
[0186] 1) Obtain the uploaded text to be segmented
[0187] Input reception: Create a user interface or API endpoint that allows users to upload text files or directly paste text content;
[0188] Format support: Ensure the ability to receive and process multiple text formats, such as TXT, PDF, Word documents, etc.;
[0189] Storage: Save the uploaded text to be segmented on a server or local storage device for subsequent processing;
[0190] 2) Preprocess to generate the target text
[0191] Text cleaning: Remove irrelevant content from the text, such as special characters, advertisements, footers, etc.;
[0192] Sentence splitting: Split the text into sentences or paragraphs for easier model processing;
[0193] Word segmentation: Perform word segmentation on each sentence to convert continuous text into discrete lexical units;
[0194] Stop word removal: Delete common words that contribute little to the analysis, such as "de" (of), "shi" (is), etc.;
[0195] Part-of-speech tagging (optional): Perform part-of-speech tagging on the word segmentation results to provide syntactic information for the model;
[0196] 3) Use the Transformer model for embedding processing
[0197] Load a pre-trained model: Select a pre-trained Transformer model, such as BERT or GPT, and load it into memory;
[0198] Text conversion: Convert the target text into a format acceptable to the Transformer model, including constructing input sequences, adding special tags (such as [CLS], [SEP]), etc.
[0199] Generate sentence embeddings: Input the transformed text into the Transformer model to obtain the embedding representation of each sentence; this usually involves the output of the previous layer of the model, that is, the hidden state of the last layer;
[0200] Embedding aggregation (optional): For longer text paragraphs, aggregation strategies (such as average pooling) can be used to generate paragraph or document-level embeddings;
[0201] 4) Post-processing of sentence embeddings (optional)
[0202] Normalization: Normalize the generated sentence embeddings to eliminate scale differences between different dimensions;
[0203] Dimensionality reduction: If the embedding dimension is too high, PCA or other dimensionality reduction techniques can be used to reduce the embedding dimension while retaining important information as much as possible;
[0204] Through the above process, the complete flow from text uploading to generating sentence embeddings can be realized, laying the foundation for subsequent topic segmentation tasks.
[0205] Furthermore, the text topic segmentation system, wherein the method generates a corresponding target weight matrix based on the embedding of each of the sentences using a preset self-attention mechanism and a learnable weight matrix calculation process, specifically includes:
[0206] Calculate the attention scores between the sentence embeddings using a preset self-attention mechanism to generate a corresponding self-attention matrix;
[0207] Based on the self-attention matrix and the preset learnable weight matrix, a corresponding target weight matrix is generated.
[0208] Furthermore, the text topic segmentation system, wherein the corresponding target weight matrix is generated based on the self-attention matrix and the preset learnable weight matrix, specifically includes:
[0209] Pre-built learnable weight matrices;
[0210] The self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix.
[0211] In the specific implementation, in this embodiment, the preset self-attention mechanism is used to calculate the attention scores between the sentence embeddings to generate a corresponding self-attention matrix; a learnable weight matrix is pre-constructed; the self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix; wherein the specific implementation process is roughly as follows:
[0212] 1) Initialize the self-attention mechanism
[0213] Configure self-attention parameters: Set the parameters required for the self-attention mechanism, including the number of heads, scaling factor, etc.
[0214] Generate Q, K, V vectors: Use the sentence embedding of the target text to generate query (Q), key (K), and value (V) vectors through a learnable linear transformation;
[0215] 2) Calculate the attention score
[0216] Calculate the attention weights: Calculate the dot product with the Q and K vectors, then apply the scaling factor and softmax function to obtain the normalized attention weights;
[0217] Generate self-attention matrix: multiply the attention weight by the V vector to get the weighted value vector, and then sum these vectors to form the self-attention matrix; this matrix reflects the correlation between sentences;
[0218] 3) Post-processing of the self-attention matrix (optional)
[0219] Recalibration: Recalibrate or normalize the self-attention matrix as needed to emphasize or suppress the relationship between certain sentences;
[0220] 4) Define and apply a learnable weight matrix
[0221] Initialize the weight matrix: Create a learnable weight matrix that has the ability to adjust according to the specific sentence context; in particular, the weight of each row must obey a normal distribution centered on the sentence embedding of that row; the purpose of this is to force each sentence embedding to pay more attention to the local information around it, rather than the information far away from its context;
[0222] Multiplication calculation: Multiply the self-attention matrix by the learnable weight matrix to generate the target weight matrix; this matrix combines the attention scores between sentences and the importance of the sentence context, which can better reflect the actual relevance between sentences;
[0223] Through the above process, we can make full use of the self-attention mechanism to capture the complex relationships between sentences, and effectively adjust and optimize these relationships through the learnable weight matrix to improve the performance of text topic segmentation.
[0224] Furthermore, the text topic segmentation system, wherein the use of the target weight matrix to adjust and process each of the sentence embeddings to generate corresponding sentence embedding representations, specifically includes:
[0225] Using the target weight matrix to perform preliminary adjustment processing on each of the sentence embeddings to generate corresponding initial sentence embeddings;
[0226] Each of the initial sentence embeddings is evaluated and optimized to generate a corresponding sentence embedding representation.
[0227] In the specific implementation, in this embodiment, the target weight matrix is used to perform preliminary adjustment processing on each of the sentence embeddings to generate a corresponding initial sentence embedding; each of the initial sentence embeddings is evaluated and optimized to generate a corresponding sentence embedding representation; wherein the specific implementation process is roughly as follows:
[0228] 1) Apply the target weight matrix for preliminary adjustment
[0229] Load the target weight matrix: Apply the target weight matrix to each sentence embedding, preparing to adjust each sentence embedding;
[0230] Weighted sentence embedding: multiply the embedding vector of each sentence by the target weight matrix, make preliminary adjustments, and generate the corresponding initial sentence embedding;
[0231] 2) Forming an initial sentence embedding set
[0232] Collect results: Collect all the preliminarily adjusted sentence embeddings to form an initial sentence embedding set;
[0233] Standardization: Standardize the initial sentence embedding set to ensure that the vectors have a uniform scale for subsequent processing;
[0234] 3) Evaluate the quality of initial sentence embeddings
[0235] Define evaluation criteria: Determine the metric to evaluate the initial sentence embeddings, such as consistency, discrimination, or relevance to known topic labels;
[0236] Perform evaluation: Score each initial sentence embedding using evaluation metrics to identify possible issues or deficiencies;
[0237] 4) Optimize initial sentence embedding
[0238] Apply optimization algorithms: Based on the evaluation results, select appropriate optimization algorithms to adjust each initial sentence embedding, such as gradient descent, regularization methods, or feature selection;
[0239] Iterative adjustment: The initial sentence embedding is continuously optimized through an iterative process until the preset stopping condition or performance indicator is met;
[0240] 5) Generate the final sentence embedding representation
[0241] Extract optimization results: Extract the final adjusted sentence embeddings from the optimization process, which should now better capture the semantic and contextual information of the text;
[0242] Generate embedding representations: Use the optimized sentence embeddings as the final sentence embedding representations, which will be used as input for topic segmentation or other downstream tasks;
[0243] Through the above process, we can ensure that the sentence embedding not only contains rich semantic information of the text, but also has been carefully adjusted and optimized to meet the needs of specific tasks.
[0244] Furthermore, the text topic segmentation system, wherein the embedding of each sentence into a representation input classifier to generate topic boundary information of the target text specifically includes:
[0245] Pre-build the classifiers required for text topic segmentation;
[0246] Inputting each of the sentence embedding representations into the classifier;
[0247] Receive a topic prediction result of the target text returned by the classifier; wherein the topic prediction result includes topic boundary information and topic labels of the target text.
[0248] In the specific implementation, in this embodiment, a classifier required for text topic segmentation is pre-built; each sentence embedding representation is input into the classifier; the topic prediction result of the target text returned by the classifier is received; wherein the topic prediction result includes the topic boundary information and topic label of the target text; wherein the specific implementation process is roughly as follows:
[0249] 1) Build a classifier
[0250] Select model architecture: According to the needs of text topic segmentation, choose a suitable classifier architecture, such as support vector machine (SVM), random forest, neural network, etc.;
[0251] Prepare training data: Collect and label the data used to train the classifier, including text and its corresponding topic boundaries and topic labels;
[0252] Train the classifier: Use the prepared data to train the classifier and adjust the model parameters until the classifier achieves the expected performance;
[0253] 2) Input sentence embedding representation to the classifier
[0254] Formatting input: Converting each sentence embedding representation into a format suitable for classifier input, which may include serialization or reshaping operations;
[0255] Input embedding: Input the embedding representation of each sentence into the pre-trained classifier to prepare for topic prediction;
[0256] 3) Perform topic prediction
[0257] Classifier reasoning: The classifier processes the input sentence embedding representation and infers the topic boundaries and topic labels in the target text;
[0258] Generate prediction results: The classifier outputs the topic prediction for each sentence or paragraph, including the location of the topic boundary and the corresponding topic label;
[0259] 4) Receive and process topic prediction results
[0260] Capture output: Receive the topic prediction results returned by the classifier, including topic boundary information and topic labels;
[0261] Result integration: Integrate the topic prediction results into an easy-to-understand format, such as matching boundary information and labels with the original target text;
[0262] Through the above process, the complete flow from sentence embedding representation to topic prediction results can be realized, providing users with an automated solution for text topic segmentation.
[0263] Furthermore, the text topic segmentation system, wherein the topic segmentation of the target text based on the topic boundary information specifically includes:
[0264] Based on the topic boundary information, the target text is topic-segmented to obtain a plurality of corresponding target topics;
[0265] A corresponding target tag is configured for each target topic through the topic tag.
[0266] In the specific implementation, in this embodiment, based on the topic boundary information, the target text is topic-segmented to obtain a plurality of corresponding target topics; a corresponding target tag is configured for each target topic through the topic tag; wherein the specific implementation process is roughly as follows:
[0267] 1) Determine the topic boundaries
[0268] Parsing topic boundary information: Based on the output provided by the classifier, identify the start and end boundaries of each topic in the target text;
[0269] Boundary marking: clearly mark these boundaries in the target text to prepare for subsequent segmentation;
[0270] 2) Perform text segmentation
[0271] Segment text: Segment the target text into multiple independent topic blocks (target topics) based on the determined topic boundaries;
[0272] Storing topics: Each segmented topic block is stored as a separate text unit for further processing;
[0273] 3) Assign topic tags
[0274] Matching labels: Matching the topic labels predicted by the classifier with the corresponding text topic chunks;
[0275] Label themes: Ensure each topic block is assigned a clear topic label for easy identification and classification;
[0276] 4) Optimize theme consistency (optional)
[0277] Review overlaps: Check if there are any overlaps or ambiguities in the content of the segmented topic blocks;
[0278] Adjust boundaries: Adjust topic boundaries as needed to improve topic consistency and readability;
[0279] 5) Generate the final topic segmentation results
[0280] Organize the results: Organize the segmented topic blocks and their topic labels into a format that is easy to understand and use;
[0281] Output results: Output the final topic segmentation results, including the specific content and corresponding labels of each topic in the target text;
[0282] Through the above process, the target text can be effectively segmented into multiple target topics, and a suitable target label can be assigned to each target topic, thereby achieving the structuring of text content and the orderly organization of information.
[0283] From the above system embodiments, it can be seen that the text topic segmentation system provided by the present invention at least includes: using a pre-trained Transformer model to embed the target text and generate multiple sentence embeddings; based on each of the sentence embeddings, using a preset self-attention mechanism and a learnable weight matrix to calculate and process, generating a corresponding target weight matrix; using the target weight matrix to adjust and process each of the sentence embeddings and generate a corresponding sentence embedding representation; inputting each of the sentence embedding representations into a classifier to generate the topic boundary information of the target text; based on the topic boundary information, performing topic segmentation on the target text; and so on. In this way, the accuracy and reliability of text topic segmentation can be effectively improved through the system of the present invention.
[0284] Specifically, the text topic segmentation system provided by the embodiment of the present invention can at least achieve the following beneficial technical effects:
[0285] 1. Enhanced interpretability: The system of the present invention can enhance the interpretability of text topic segmentation. By adjusting the attention mode, the importance of sentences in different contexts can be dynamically adjusted. Such a mechanism makes the output attention distribution more interpretable, which can help users understand the basis for judging the relationship between sentences and improve the transparency and reliability of text topic segmentation.
[0286] 2. Improved local context capture: The system of the present invention aims to emphasize the local relationship between sentences, and can better capture and utilize the local context information of sentences; this ability to focus on local context is very important for the task of text topic segmentation, because it enables the system of the present invention to more accurately divide topic boundaries and improve the accuracy of segmentation;
[0287] 3. Improve accuracy and efficiency: By constraining the attention scores of the self-attention matrix to follow a specific distribution, the system of the present invention can better adapt to the dialogue scenario and improve the accuracy of the text topic segmentation task; at the same time, the system of the present invention does not require large-scale architectural changes and can achieve efficient component integration and rapid deployment;
[0288] 4. Practical application value: Text topic segmentation is widely used in many industries, including news media, market research, social media analysis and customer feedback analysis; the application of the system of the present invention can improve the application effect of enterprises in the fields of information organization, content summarization, sentiment analysis, targeted advertising and intelligent customer service, which will provide more accurate and efficient data processing and decision support for related industries;
[0289] 5. Scalability and adaptability: The application of the system of the present invention is highly flexible and adaptable, and can be customized and optimized according to specific tasks and needs, which enables researchers and practitioners to freely choose a topic segmentation system that suits them according to actual conditions;
[0290] The system of the present invention can effectively overcome the limitations of the traditional Transformer model in the topic segmentation task and obtain better interpretability, local context capture, accuracy and practical application value, which can provide new development directions and opportunities for research and practical applications related to topic segmentation.
[0291] Based on the above method embodiment, please refer to Figure 8 Another embodiment of the present invention further provides a computer device, wherein the computer device 10 includes:
[0292] memory 120 and one or more processors 110, Figure 8 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a communication bus or other means. Figure 8 The example of connecting via a communication bus is taken as an example.
[0293] The processor 110 is used to complete various control logics of the computer device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP, or any other such configuration.
[0294] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the computer program corresponding to the text topic segmentation method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the computer device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the text topic segmentation method in the above method embodiment.
[0295] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device or at least one function; the data storage area may store data created according to the use of the computer device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the computer device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0296] One or more units are stored in the memory 120, and when executed by one or more processors 110, the text topic segmentation method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S500.
[0297] Those skilled in the art will understand that Figure 8 The hardware structure diagram shown in the figure is only a schematic diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0298] Based on the above method embodiments, another embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the text topic segmentation method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S500.
[0299] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synch link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0300] Based on the above method embodiments, another embodiment of the present invention further provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the text topic segmentation method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S500.
[0301] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0302] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0303] Conditional language such as "can," "can," "might," or "may," unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey, among other things, that a particular embodiment can include (while other embodiments do not) a particular feature, element, and / or operation. Thus, such conditional language is also generally intended to imply that a feature, element, and / or operation is required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.
[0304] What has been described herein, in this specification and in the accompanying drawings includes examples that can provide a method, system, computer device, and non-volatile computer-readable storage medium for text topic segmentation. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure, but all these various modifications should belong to the scope of protection of the claims attached to the present invention. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of the present specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in the present specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are used in this article, they are used in a general and descriptive sense and are not used for limiting purposes.
Claims
1. A text topic segmentation method, characterized in that: include: Use the pre-trained Transformer model to embed the target text and generate multiple sentence embeddings; Based on the sentence embeddings, a corresponding target weight matrix is generated using a preset self-attention mechanism and a learnable weight matrix calculation process; Using the target weight matrix to adjust and process each of the sentence embeddings to generate a corresponding sentence embedding representation; Embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text; Based on the topic boundary information, the target text is segmented into topics.
2. The text topic segmentation method according to claim 1, characterized in that: The pre-trained Transformer model is used to embed the target text to generate multiple sentence embeddings, including: Get the uploaded text to be segmented; Preprocessing the text to be segmented to generate corresponding target text; The target text is embedded using a pre-trained Transformer model to generate multiple sentence embeddings.
3. The text topic segmentation method according to claim 2, characterized in that: Based on the embedding of each of the sentences, a preset self-attention mechanism and a learnable weight matrix are used for calculation and processing to generate a corresponding target weight matrix, including: Calculate the attention scores between the sentence embeddings using a preset self-attention mechanism to generate a corresponding self-attention matrix; Based on the self-attention matrix and the preset learnable weight matrix, a corresponding target weight matrix is generated.
4. The text topic segmentation method according to claim 3, characterized in that: The step of adjusting and processing each of the sentence embeddings using the target weight matrix to generate a corresponding sentence embedding representation includes: Using the target weight matrix to perform preliminary adjustment processing on each of the sentence embeddings to generate corresponding initial sentence embeddings; Each of the initial sentence embeddings is evaluated and optimized to generate a corresponding sentence embedding representation.
5. The text topic segmentation method according to claim 4, characterized in that: The embedding of each sentence into a representation input classifier to generate topic boundary information of the target text includes: Pre-build the classifiers required for text topic segmentation; Inputting each of the sentence embedding representations into the classifier; Receive a topic prediction result of the target text returned by the classifier; wherein the topic prediction result includes topic boundary information and topic labels of the target text.
6. The text topic segmentation method according to claim 5, characterized in that: The subject segmentation of the target text based on the subject boundary information includes: Based on the topic boundary information, the target text is topic-segmented to obtain a plurality of corresponding target topics; A corresponding target tag is configured for each target topic through the topic tag.
7. The text topic segmentation method according to any one of claims 3 to 6, characterized in that: The generating a corresponding target weight matrix based on the self-attention matrix and the preset learnable weight matrix includes: Pre-built learnable weight matrices; The self-attention matrix is multiplied by the learnable weight matrix to generate a corresponding target weight matrix.
8. A text topic segmentation system, characterized in that: include: The embedding processing module is used to embed the target text using the pre-trained Transformer model to generate multiple sentence embeddings; A calculation processing module, used for generating a corresponding target weight matrix based on the sentence embeddings using a preset self-attention mechanism and a learnable weight matrix calculation processing; An adjustment processing module, used to adjust and process each of the sentence embeddings using the target weight matrix to generate a corresponding sentence embedding representation; An information generation module, used for embedding each of the sentences into a representation input classifier to generate topic boundary information of the target text; The topic segmentation module is used to perform topic segmentation on the target text based on the topic boundary information.
9. A computer device, characterized in that: The computer device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the text topic segmentation method as described in any one of claims 1-7 can be implemented.
10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the text topic segmentation method according to any one of claims 1 to 7 can be implemented.
Citation Information
Cited By
Intelligent file centralized management method and device in information system, equipment and medium
CN120705114A
