Network event thread generation method and device, storage medium and program product

By generating network event contexts using the pre-trained language model BERT and a lightweight context rewriter, the problem of high hardware computing power requirements is solved, achieving efficient and accurate event context generation, reducing hardware requirements and improving the quality of generated event contexts.

CN120494092BActive Publication Date: 2026-07-24BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2025-04-30
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies require significant hardware computing power to generate network event contexts, making them difficult to deploy effectively in practical applications.

Method used

The pre-trained language model BERT is used to generate word vector representations of event posts, extract extractive summaries and associate them with event sentences, generate rewritten summary text through a lightweight context rewriter, perform semantic similarity filtering, and combine social interaction features to filter key event posts and construct the event context.

Benefits of technology

It reduces hardware performance requirements, simplifies the deployment process, improves the accuracy and relevance of event context generation, and ensures that the generated event context focuses on valuable information, while maintaining conciseness and readability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120494092B_ABST
    Figure CN120494092B_ABST
Patent Text Reader

Abstract

The application provides a network event context generation method and device, a storage medium and a program product. The method comprises the following steps: obtaining event posts and post times of a target user about a target event; inputting the event posts into a pre-trained language model to obtain vector representations of each word element; extracting an extractive summary corresponding to each event post, and adding a sentence identifier to each sentence in the extractive summary in sequence; matching the summary sentences to the sentences in the event posts, marking the word elements in the event sentences with the sentence identifier as group markers, and vectorizing the group markers to obtain group marker embeddings, and combining the word element representations with the group marker embeddings to obtain word element representations; inputting the word element representations of the event posts into a context rewriter, outputting rewritten summary texts, filtering the summary texts according to semantic similarity, and sorting the summary texts according to the post times to obtain an event context. The application is used to solve the problem that the prior art needs high hardware computing power in the network event context generation process and is difficult to be deployed in practical applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and program product for generating network event contexts. Background Technology

[0002] Cyber ​​incidents refer to various behaviors and phenomena occurring through online platforms, including but not limited to verbal attacks, personal attacks, privacy breaches, malicious defamation, and other forms of cyberbullying, as well as other activities such as the spread of misinformation, public opinion manipulation, and social movements. These behaviors and phenomena may cause psychological harm or reputational damage to individuals and may also have a wide-ranging impact on society. With the popularization of the internet and the development of social media, various cyber incidents occur frequently, bringing numerous challenges and negative impacts to society. To effectively address these issues, the need for a rapid and efficient solution for generating cyber incident timelines is becoming increasingly urgent.

[0003] Currently, traditional methods for generating network event contexts include: unsupervised learning-based schemes, graph neural network-based schemes, and large language model-based schemes. These schemes extract information through empirical learning, require significant computing resources, and place high demands on hardware and deployment schemes when high accuracy is required. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, storage medium, and program product for generating network event contexts, in order to eliminate or improve one or more defects existing in the prior art, and to solve the problem that the prior art requires high hardware computing power in the process of generating network event contexts, making it difficult to deploy in practical applications.

[0005] One aspect of the present invention provides a method for generating network event context, the method comprising the following steps:

[0006] Obtain at least one post from a target user regarding a target event and its corresponding posting time from multiple online platforms;

[0007] The event post is input into a pre-trained language model to obtain a vector representation of each word element;

[0008] Extract the extractable summary corresponding to each event post, and add sentence tags to the summary sentences in the extractable summary in order;

[0009] Based on semantic matching, the summary sentences are associated with and matched to the event sentences in each event post, and the sentence identifier of the summary sentence corresponding to the lexical tag in the event sentence is used as the group tag;

[0010] The group token of each word is vectorized to obtain the corresponding group token embedding, and then combined with the vector representation of each word to obtain the word representation;

[0011] The lexical representation of each word in each event post is input into a preset context rewriter, which outputs a rewritten summary text of each event post; the context rewriter is a decoder based on the Transformer architecture.

[0012] The rewritten summary text is semantically similar and sorted by publication time to obtain the event timeline corresponding to the target event.

[0013] In some embodiments of the present invention, obtaining at least one event post by a target user regarding a target event and its corresponding posting time from multiple network platforms includes:

[0014] Based on the event identifier of the target event and the user identifier of the target user, the initial event post, the social interaction data corresponding to the initial event post, and the posting time are obtained by filtering from multiple online platforms;

[0015] Based on social interaction data and the pre-assigned weights for each piece of social interaction data, the social interaction features corresponding to each initial event post are calculated using a weighted average.

[0016] The initial event posts were sorted according to their posting times, and a curve was constructed with the corresponding social interaction characteristics as the dependent variable.

[0017] The initial event post corresponding to the peak in the curve is retained to obtain at least one event post.

[0018] In some embodiments of the present invention, after retaining the initial event post corresponding to the peak in the curve graph and obtaining at least one event post, the method further includes:

[0019] The feature threshold is obtained by multiplying the mean of the social interaction features corresponding to the initial event post by a preset coefficient.

[0020] The retained event posts are further filtered using feature thresholds, retaining event posts whose social interaction characteristics are greater than the feature threshold.

[0021] In some embodiments of the present invention, the training process of the context rewriter includes:

[0022] Obtain sample training data; the sample training data includes sample text and corresponding sample summaries; group tags are added to the word elements in the sample text;

[0023] The group tokens of each word in the sample text are vectorized to obtain the corresponding group token embeddings, and then combined with the vector representations of each word to obtain the sample word representations.

[0024] The sample word representations are input into the initial Transformer model to obtain the rewritten results;

[0025] Input the rewritten results and sample summary into the preset loss function to obtain the loss result;

[0026] The loss result is used to iterate over the parameters of the initial Transformer model until the model converges, resulting in a context rewriter.

[0027] In some embodiments of the present invention, semantic similarity filtering of the rewritten summary text includes:

[0028] The rewritten summary text is input into a pre-trained semantic similarity model in the form of text pairs, and the output is a similarity label. The similarity label is used to indicate the degree of semantic similarity between the input text pairs. The semantic similarity model includes an input embedding layer, an output encoding layer, and an angle difference acquisition layer. The input embedding layer receives the input text pairs and generates the real part embedding and imaginary part embedding corresponding to each word in the text pair. The output encoding layer inputs the real part embedding and imaginary part embedding into the pre-trained language model to obtain the encoded output. The angle difference acquisition layer constructs the complex representation of the input text pairs based on the encoded output, calculates the angle difference between the two complex representations through complex division, and determines the similarity label of the input text pairs.

[0029] The similarity label indicates that text pairs with the same semantics will be selectively retained.

[0030] In some embodiments of the present invention, the pre-training process of the semantic similarity model includes:

[0031] Acquire training data; training data includes sample text pairs and corresponding sample similarity labels; sample text pairs include positive sample text pairs and negative sample text pairs;

[0032] The sample text is input into the initial semantic similarity model to obtain the training results;

[0033] The training results and sample similarity labels are input into a preset loss function to obtain the loss result; the preset loss function includes the angle target loss function and the supervised contrastive learning target loss function;

[0034] The initial semantic similarity model is iteratively trained based on the loss results, and the model parameters are updated until the model converges to obtain the language similarity model.

[0035] In some embodiments of the present invention, semantic similarity filtering of the rewritten summary text includes:

[0036] The rewritten summary text is input into a pre-trained language model to obtain a vector representation of each rewritten summary text;

[0037] Based on the vector representation of each rewritten summary text and a preset similarity algorithm, the similarity between each pair of rewritten summary texts is determined;

[0038] The similarity between each rewritten summary text pair is compared with a preset similarity threshold, and the Chinese text of the rewritten summary text pair with a similarity greater than the preset similarity threshold is selected and retained.

[0039] Another aspect of the present invention provides a network event context generation apparatus, including a processor, a memory, and a computer program / instructions stored in the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the apparatus implements the steps of the network event context generation method as described above.

[0040] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the network event context generation method as described above.

[0041] Another aspect of the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the network event context generation method as described above.

[0042] The beneficial effects of the present invention include at least the following:

[0043] The network event context generation method and apparatus of the present invention address the problem that existing technologies require high hardware computing power in the network event context generation process, making them difficult to deploy in practical applications. By employing a pre-trained language model BERT to generate vector representations of lexical units in each event post, extracting an extractable summary corresponding to each event post, associating the summary sentences in the extractable summary with the corresponding event sentences in the event post, and tagging the lexical units in the event sentences with group tags, the vector representations of reinforced lexical units are embedded through the group tags to guide subsequent summary text generation. The lexical representations corresponding to each event post are input into a lightweight context rewriter. The small model outputs rewritten summary text, and finally filters out semantically repetitive summary text and sorts it chronologically to obtain the event timeline. In this way, event timelines can be generated through extractive summarization and a lightweight small model, without the need to deploy complex large language models. This significantly reduces the demand for hardware performance and simplifies the deployment process. It can run efficiently in resource-constrained scenarios and achieve high-precision event timeline generation. At the same time, through a precise target user and target event filtering mechanism, a large number of irrelevant and noisy posts in social media can be effectively filtered out, ensuring that the generated event timelines focus on truly valuable event information, thus improving the accuracy and relevance of the generated event timelines.

[0044] In addition, by integrating the three social interaction data points of likes, reposts, and comments from all initial event posts, the social interaction characteristics are determined, and a curve is constructed according to the posting time. This allows for the precise extraction of event posts corresponding to peaks in the event's development process. By comprehensively considering the overall trend of the target event's development, all key nodes from the beginning to the end of the event can be captured more comprehensively, resulting in a complete and meaningful event timeline.

[0045] In addition, to extract key event posts more accurately, it is necessary to determine a feature threshold based on social interaction characteristics. This allows for further filtering of event posts corresponding to peaks, removing those with social interaction characteristics below the feature threshold. This effectively identifies and retains truly influential event posts, ensuring that the final event timeline more accurately reflects the development of events and their social impact.

[0046] In addition, a small model is used to perform semantic similarity filtering on the rewritten summary text to remove redundant text with the same semantics, thereby improving the simplicity and readability of the final generated event timeline.

[0047] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.

[0048] Those skilled in the art will understand that the objectives and advantages achievable with this invention are not limited to those specifically described above, and that the above and other objectives achievable with this invention will become clearer from the following detailed description. Attached Figure Description

[0049] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:

[0050] Figure 1 This is a flowchart of a network event context generation method provided in an embodiment of the present invention.

[0051] Figure 2 This is a schematic diagram of the framework of a network event context generation method provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0053] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0054] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0055] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0056] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0057] The channel reconstruction method based on a multi-probe microwave anechoic chamber provided in this application will be described in detail below.

[0058] This embodiment provides a channel reconstruction method based on a multi-probe microwave anechoic chamber, such as... Figure 1 As shown, the method includes at least the following steps S101 to S107:

[0059] Step S101: Obtain at least one event post by the target user regarding the target event and its corresponding posting time from multiple network platforms.

[0060] In this context, the target event refers to the event in which a timeline needs to be established. The target users are social media users (such as authoritative news media or large corporations) who publish text content about the target event on multiple social media platforms. Event posts refer to news, announcements, or threads about the target event published by target users on multiple online platforms.

[0061] In some embodiments of the present invention, posts by target users on social media platforms related to a target event are obtained. This includes at least the following two stages:

[0062] The first stage is the official document acquisition stage, which involves obtaining official documents by querying the user identifier of the target user and the event identifier of the target event.

[0063] In this context, an event identifier is used to uniquely indicate a target event; different target events correspond to different event identifiers. An event identifier can be a keyword or combination of keywords related to the target event; alternatively, it can be an identifier composed of numbers, letters, or characters. This embodiment does not limit the implementation method of the event identifier.

[0064] User identifiers refer to identifiers used to indicate a user's identity, including identifiers used to uniquely identify a user across multiple social platforms (such as usernames, user IDs, email addresses used when registering on social platforms, or other forms of identifiers) or identifiers used to indicate a user's category (such as authentication identifiers for media, businesses, students, etc.).

[0065] In each social media platform, user identifiers are typically used to distinguish user identities across different categories. User categories will influence the determination of subsequent key event posts. Therefore, it is necessary to obtain as many event posts as possible through user category identifiers, which are conducive to extracting the event's context, and completely filter out irrelevant posts to obtain the initial event posts.

[0066] For example, taking user identifiers as numbers, including 1-6, where 1 represents enterprise users, 2 represents media organizations, 3 represents campus users, 4 represents website users, 5 represents application users, and 6 represents groups; in the official document retrieval stage, user identifiers can be set to 1 and 2, combined with the event identifier of the target event, to query and save the key event documents corresponding to the target event.

[0067] Specifically, official posts are filtered out by the user identifier of the target user and the event identifier of the target event. This includes: searching for user posts corresponding to the target event on multiple social media platforms using the event identifier and user identifier; or, user posts on multiple social media platforms are pre-stored in a specified database (such as MySQL or Oracle databases), and user posts related to the target event are retrieved by querying the database using the event identifier and user identifier.

[0068] The second phase is the official post selection phase. This involves filtering official posts based on social media interaction data.

[0069] Social interaction data refers to various data generated when users interact with other users on social platforms, reflecting other users' interest in the content, participation, and the content's dissemination effect.

[0070] Because high-interaction event posts can quickly gather a large number of comments, shares, and likes, they become real-time indicators of event progress, providing first-hand information for constructing a complete event timeline. They can better reflect changes in public opinion and sentiment, and more accurately grasp the overall development and impact of the event. Based on this, in some embodiments of the present invention, initial event posts are filtered using social interaction data, selecting those with high social interaction data as key posts.

[0071] The initial event posts obtained by querying the event identifier of the target event and the user identifier of the target user through social interaction data are further filtered to identify event posts with high social activity data.

[0072] For example: Reference Figure 2 First, filter out the posts corresponding to the target event on social media platforms, including posts m1 to m6. Then, filter these posts based on the target user identifier to obtain posts m1, m3, m5, and m6 posted by the target user about the target event. Next, further filter based on social interaction data to obtain the key posts, including posts m1, m5, and m6.

[0073] In some embodiments of the present invention, social interaction data includes the number of reposts, likes, and / or comments.

[0074] Specifically, the process involves obtaining at least one post from a target user regarding a target event and its corresponding posting time from multiple online platforms. This includes: filtering the initial event post, the corresponding social interaction data, and the posting time from multiple online platforms based on the event identifier of the target event and the user identifier of the target user; comparing the number of reposts in the social interaction data with a preset repost threshold, and retaining the initial event post with a repost count greater than the preset repost threshold; and / or comparing the number of likes in the social interaction data with a preset like threshold, and retaining the initial event post with a like count greater than the preset like threshold; and / or comparing the number of comments in the social interaction data with a preset comment threshold, and retaining the initial event post with a comment count greater than the preset comment threshold.

[0075] In other embodiments of the present invention, social interaction features are obtained by assigning different weights to the three feature variables of the number of likes, reposts and comments of official posts, and then adding them together, which serve as the basis for screening.

[0076] The weights of likes, shares, and comments can be the same or different. For example, the weights of likes, shares, and comments can be 1, 0.5, and 0.5, respectively; or, the weights of likes, shares, and comments can be 0.7, 0.4, and 0.6, respectively. This embodiment does not limit the weight values ​​of likes, shares, and comments.

[0077] After calculating the social interaction features corresponding to each initial event post, each initial event post is arranged in chronological order of posting time, and a curve is formed with the social interaction features as the dependent variable. The initial event post corresponding to the peak in the curve is identified as the key event post.

[0078] Specifically, the process involves obtaining at least one event post from a target user regarding a target event and its corresponding posting time from multiple online platforms. This includes: filtering initial event posts, corresponding social interaction data, and posting times from multiple online platforms based on the event identifier of the target event and the user identifier of the target user; calculating the social interaction features corresponding to each initial event post based on the social interaction data and pre-assigned weights for each piece of social interaction data; sorting the initial event post pairs according to their corresponding posting times and constructing a curve graph with the corresponding social interaction features as the dependent variable; and retaining the initial event posts corresponding to the peaks in the curve graph to obtain at least one event post.

[0079] In practice, social interaction data may also include the number of reports, the number of favorites, or the reading time. This embodiment does not limit the implementation method of social interaction data.

[0080] In addition, in order to select the key events with the greatest public attention and social impact, while avoiding the misselection of unrepresentative event posts due to short-term abnormal activity, and to ensure the accuracy and effectiveness of the event context generation, after determining the social interaction characteristics of the initial event posts, it is also necessary to calculate a feature threshold applicable to the target event by combining all social interaction characteristics, so as to further filter the event posts corresponding to the peaks in the curve.

[0081] By filtering out event posts corresponding to peaks with social interaction characteristics below the feature threshold, we can effectively identify and retain truly influential event posts, thereby further optimizing the quality of the final set of event posts and making the final event posts more accurately reflect the development dynamics of events and their social impact.

[0082] In some embodiments of the present invention, the feature threshold is obtained by multiplying the average social interaction feature corresponding to the initial event post by a preset coefficient. The preset coefficient may include 0.7, 0.8, or 0.9, etc. In actual implementation, the preset coefficient can be flexibly adjusted according to different target events, so that the calculated feature threshold can adapt to different target events. This embodiment does not limit the value of the preset coefficient.

[0083] Specifically, after further filtering the initial event posts based on the curve graph and retaining the initial event posts corresponding to the peaks in the curve graph to obtain the at least one event post, the method further includes: multiplying the mean of the social interaction features corresponding to the initial event posts by a preset coefficient to obtain a feature threshold; and using the feature threshold to further filter the retained event posts, retaining event posts whose social interaction features are greater than the feature threshold.

[0084] In practice, the event posts corresponding to the peaks in the curve can also be further filtered using percentages, such as retaining only the top 80% or 90% of the event posts corresponding to the peaks. This embodiment does not limit the implementation method of further filtering event posts corresponding to the peaks in the curve.

[0085] Step S102: Input the event post into the pre-trained language model to obtain the vector representation of each word.

[0086] In some embodiments of the present invention, the pre-trained language model BERT is used to encode the original event post, and the semantic capture capability of the BERT model is used to deeply understand the text content of the event post and transform it into a high-dimensional vector representation.

[0087] In the process of obtaining vector representations through pre-trained language models, the number of sentences extracted from event posts can be flexibly controlled according to actual needs by adjusting the hyperparameters of the BERT model, so as to achieve better recall or adapt to the needs of specific tasks.

[0088] Step S103: Extract the extractable summary corresponding to each event post, and add sentence identifiers to the summary sentences in the extractable summary in order.

[0089] Extractive summarization refers to a summary formed by selecting sentences or phrases from the original event post. It is easy to implement and stable because it directly uses sentences from the original text, so there will be no problems with grammatical errors or deviation from the topic.

[0090] In some embodiments of the present invention, extractable summaries can be obtained from each event post using word, word frequency, and position statistics methods.

[0091] In practice, other natural language processing techniques, such as abstract active summarization, semantic analysis, and keyword extraction, can also be used to extract summaries corresponding to each event post.

[0092] After obtaining the extractable summaries corresponding to each event post, sentence identifiers are added sequentially to the summary sentences in each extractable summary. The sentence identifiers can be any combination of numbers, letters, or characters; this embodiment does not limit the implementation method of the sentence identifiers.

[0093] For example, taking an extractable summary including summary m1 and summary m5 as an example, summary m1 includes sentence a and sentence b, with sentence a labeled as 1 and sentence b labeled as 2; summary m5 includes sentence c, with sentence c labeled as 1.

[0094] Step S104: Based on semantic matching, the summary sentence is associated with the event sentence in each event post, and the sentence identifier of the summary sentence corresponding to the lexical tag in the event sentence is used as the group tag.

[0095] By semantically matching the summary sentences in the extracted summary with the event sentences in the original event post, and adding sentence identifiers identical to those in the corresponding summary sentences to the tokens in the original event post as group tags, a direct link is established between the extracted summary and the original event post. In the subsequent rewriting process, these group tags enable more accurate localization. This approach effectively improves the quality of the rewritten summary text and reduces the algorithm's complexity without using reinforcement learning or copying mechanisms.

[0096] For example, take the extractable summary n5 and its corresponding event post m5 as an example; the extractable summary n5 includes sentence d and sentence e, the sentence identifier of sentence d is 4, and the sentence identifier of sentence e is 5; the event post m5 includes sentence D and sentence E; perform semantic matching between the extractable summary n5 and the event post m3, label sentence D and each word tag group in sentence D with 4, and label sentence E and each word tag group in sentence E with 5.

[0097] In some embodiments of the present invention, the similarity between the summary sentences in the extracted summary and the event sentences in the event post is calculated using cosine similarity or other similarity measures, and semantic matching is performed between the extracted summary and the event post. For each summary sentence, the event sentence with the highest similarity is selected as the matching result.

[0098] Step S105: Vectorize the group token of each word to obtain the corresponding group token embedding, and combine it with the vector representation of each word to obtain the word representation.

[0099] In some embodiments of the present invention, the group tag embedding corresponding to a word can be obtained through group tag query. For each type of group tag, a fixed-dimensional group tag vector is initialized as the group tag embedding of that group tag, and the group tag embedding and vector representation of the same word are in the same vector space.

[0100] Specifically, the group token of each word is vectorized to obtain the corresponding group token embedding, including: querying the group token embedding corresponding to the group token of each word through a preset mapping relationship between the group token and the group token embedding.

[0101] In practice, real-time implementation is possible, and group tag embeddings can be pre-obtained using parameters from a pre-trained language model. This embodiment does not limit the implementation method of group tag vectorization for each lexical unit.

[0102] By combining the group tag embedding of each lexical with its corresponding vector representation, we obtain the lexical representation for each word.

[0103] In some embodiments of the present invention, the lexical representation is obtained by directly concatenating the group tag embedding with the vector representation. This preserves more of the original information. For example, if the vector representation of a lexical is 768-dimensional and the corresponding group tag embedding is also 768-dimensional, then the concatenated lexical representation will be 1536-dimensional.

[0104] In other embodiments of the present invention, the group tag embedding and the vector representation are directly added together by vector addition to obtain the lexical representation, thereby simplifying the operation. For example, if the vector representation is a 768-dimensional vector and the corresponding group tag embedding is also a 768-dimensional vector, then the two vectors can be directly added together, and the result is still a 768-dimensional vector, which serves as the lexical representation of that lexical.

[0105] Step S106: Input the lexical representation of each word in each event post into a preset context rewriter and output the rewritten summary text of each event post.

[0106] The context rewriter is a decoder based on the Transformer architecture. It is trained based on a pre-configured Transformer model.

[0107] Specifically, the training process of the context rewriter includes: acquiring sample training data, which includes sample text and corresponding sample summaries; adding group tags to the tokens in the sample text; vectorizing the group tags of each token in the sample text to obtain the corresponding group tag embeddings, and combining them with the vector representations corresponding to each token to obtain the sample token representations; inputting the sample token representations into the initial Transformer model to obtain the rewriting results; inputting the rewriting results and sample summaries into a preset loss function to obtain the loss results; using the loss results to iterate the parameters of the initial Transformer model until the model converges to obtain the context rewriter.

[0108] The preset loss function includes, but is not limited to, the cross-entropy loss function or the contrastive loss function.

[0109] After the lexical representations enhanced by group-tag embeddings are input into the context rewriter, they are decoded using its Transformer architecture. During decoding, each sentence is treated as an independent group. During the beam search of the context rewriter, group-tag embeddings guide the generation of the next word or sentence in real time. Each time the next word is selected, the context rewriter considers not only the probability distribution of the current sequence but also the group tags of the current path to decide whether to continue building sentences belonging to the same group, ensuring that the rewritten summary text reflects the structure of the original text while improving coherence and accuracy.

[0110] Simultaneously, during the process of rewriting the summary text using group-marked embeddings, the attention mechanism of the context rewriter is constrained to ensure that the generated k-th sentence corresponds to the k-th summary text in the original event post. The rewritten summary text begins with the special marker [BOS], sentences are separated by [SEP], and it ends with [EOS]. In this way, effective compression and rewriting of the summary text can be achieved while ensuring the integrity and accuracy of the summary content, thereby improving the conciseness and readability of the rewritten summary text.

[0111] For example: Reference Figure 2 The lexical representations of each word in event post m1 are input into the context rewriter to obtain the rewritten summary text n1; the lexical representations of each word in event post m5 are input into the context rewriter to obtain the rewritten summary text n5; the lexical representations of each word in event post m6 are input into the context rewriter to obtain the rewritten summary text n6.

[0112] Step S107: Perform semantic similarity filtering on the rewritten summary text and sort it according to the publication time to obtain the event context corresponding to the target event.

[0113] Because some rewritten summary texts may still have semantic similarities, after obtaining the rewritten summary text through the context rewriter, it is necessary to perform semantic similarity filtering on the rewritten summary text to remove redundant text with semantic repetition, thereby improving the conciseness and readability of the final generated event context.

[0114] For example: Reference Figure 2 Taking semantic similarity filtering of rewritten summary texts n1, n5, and n6 as an example: if rewritten summary texts n1 and n6 are semantically similar, rewritten summary text n1 is retained, and the final event timeline is constructed based on rewritten summary texts n1 and n5; or, if rewritten summary texts n5 and n6 are semantically similar, rewritten summary text n5 is retained, and the final event timeline is constructed based on rewritten summary texts n1 and n5.

[0115] In some embodiments of the present invention, the rewritten summary text is input into a pre-trained small model—a language similarity model—in the form of text pairs. The language similarity model performs a deep semantic similarity determination on the input text pairs based on angle-optimized embedding and outputs the similarity labels of the input text pairs.

[0116] The similarity label is used to indicate the degree of semantic similarity between input text pairs. Based on the semantic similarity indicated by the similarity label, redundant summary texts with similar semantics are filtered out, ensuring that each rewritten summary text is semantically unique after filtering.

[0117] Specifically, semantic similarity filtering of the rewritten summary text includes: inputting the rewritten summary text into a pre-trained semantic similarity model in the form of text pairs, and outputting similarity labels; and selectively retaining one of the text pairs whose similarity labels indicate that they have the same semantics.

[0118] In some embodiments of the present invention, the semantic similarity model includes an input embedding layer, an output encoding layer, and an angle difference acquisition layer.

[0119] The input embedding layer receives text pairs and generates real and imaginary embeddings for each lexical unit in the text pair. By decomposing the text embeddings into real and imaginary parts, surface differences can be learned using the real parts and subtle semantic differences using the imaginary parts, thereby better exploring the similarity of embeddings between sentences.

[0120] The output encoding layer is used to input the real part embeddings and imaginary part embeddings into the pre-trained language model (BERT model) to obtain the encoded output, which includes the real part text embeddings and the imaginary part text embeddings.

[0121] In practice, the output encoding layer can also obtain the encodings corresponding to the real and imaginary embeddings in other ways, such as inputting the real and imaginary embeddings into other language models (e.g., Large Language Model MetaAI) to obtain the corresponding encoded outputs.

[0122] The angle difference layer constructs a complex representation of the input text pair based on the encoded output, and calculates the angle difference between the two complex representations by complex division to determine the similarity label of the input text pair.

[0123] Taking a text pair including text A and text B as an example, the complex representation of text A is z. A The complex representation of text B, z B They can be expressed by the following formulas:

[0124] Z A =x A +iy A

[0125] Z B =x B +iy B

[0126] In the formula, x A Represents the real text embedding of text A; y A The imaginary part of text A is embedded; x B Represents the real text embedding of text B; y B This indicates the imaginary part of text B; i represents the imaginary unit.

[0127] The angle difference between two complex numbers can be calculated using the following formula:

[0128]

[0129] In the formula, x A Represents the real text embedding of text A; y A The imaginary part of text A is embedded; x B Represents the real text embedding of text B; y B This represents the virtual part of the text embedding in text B.

[0130] In some embodiments of the present invention, the semantic similarity model is trained by using a supervised contrastive loss function as an auxiliary objective, and combining the angular objective and the auxiliary objective as the final loss function. Specifically, the final loss function can be expressed by the following formula:

[0131] L = w1·L angle+w2·L cl

[0132] In the formula, L angle Indicates an angular target; L cl w1 represents the weight of the angular objective; w2 represents the weight of the supervised contrastive learning objective.

[0133] The angle objective is used to minimize the angle difference between highly similar text pairs while maximizing the angle difference between low-similarity text pairs. This helps to reflect subtle semantic differences in the cosine-saturated region and mitigates the negative impact of gradient vanishing. Specifically, the angle objective L... angle It can be expressed by the following formula:

[0134]

[0135] In the formula, s ij The training sample text pairs (x) i x j The similarity of ) ; Δθ ij Represents sample text pairs (x i x j ) angle difference; s mn Represents sample text pairs (x m x n The similarity of ) ; Δθ mn Represents sample text pairs (x m x n The angle difference is represented by τ; τ represents the temperature hyperparameter.

[0136] Supervised contrastive learning objectives L cl It can be expressed by the following formula:

[0137]

[0138] In the formula, τ represents the temperature hyperparameter; b represents the b-th training batch; n represents the number of positive sample texts; and N represents the size of each training batch. This represents the text of the i-th sample in the b-th training batch; express The corresponding positive sample text; Represents sample text The corresponding positive sample text.

[0139] By comprehensively learning text embeddings from multiple perspectives, the overall performance of the model is improved, enabling it to perform well on different tasks and datasets. At the same time, defining angular targets in a complex space can more effectively reflect the subtle semantic differences of embedding pairs in the cosine saturation region, alleviate the negative impact of gradient vanishing, and enable the model to learn semantic similarity better.

[0140] Specifically, the pre-training process of the semantic similarity model includes: acquiring training data; the training data includes sample text pairs and corresponding sample similarity labels; the sample text pairs include positive sample text pairs and negative sample text pairs; inputting the sample text pairs into the initial semantic similarity model to obtain the training results; inputting the training results and sample similarity labels into a preset loss function to obtain the loss results; the preset loss functions include ranking, angle target loss function, and supervised contrastive learning target loss function; iteratively training the initial semantic similarity model based on the loss results, updating the model parameters, until the model converges to obtain the language similarity model.

[0141] In other embodiments of the present invention, the vector representation corresponding to each rewritten summary text is extracted by the pre-trained language model BERT, and the similarity between different rewritten summary texts is determined based on a pre-set similarity algorithm, so as to remove semantically repetitive and redundant summary texts.

[0142] The pre-set similarity algorithm includes, but is not limited to, cosine similarity, Euclidean distance, or Manhattan distance. This embodiment does not limit the similarity algorithm.

[0143] Specifically, semantic similarity filtering of the rewritten summary text includes: inputting the rewritten summary text into a pre-trained language model to obtain the vector representation corresponding to each rewritten summary text; determining the similarity between each pair of rewritten summary texts based on the vector representation corresponding to each rewritten summary text and a preset similarity algorithm; comparing the similarity between each pair of rewritten summary texts with a preset similarity threshold, and selectively retaining one text from each pair of rewritten summary texts with a similarity greater than the preset similarity threshold.

[0144] In summary, the network event context generation method provided in this embodiment addresses the problem that existing technologies require high hardware computing power during network event context generation, making them difficult to deploy in practical applications. It utilizes a pre-trained language model BERT to generate vector representations of lexical units in each event post, extracts an extractable summary corresponding to each event post, associates the summary sentences in the extractable summary with the corresponding event sentences in the event post, and tags the lexical units in the event sentences with group tags. The vector representations of reinforced lexical units are embedded using the group tags to guide subsequent summary text generation. The lexical representations corresponding to each event post are then input into a lightweight context rewriter. The system uses a small, lightweight model to output rewritten summary text. Finally, semantically redundant summary texts are filtered out, and the event timeline is sorted chronologically to obtain the event timeline. This approach, using extractive summarization and a lightweight model, enables event timeline generation without the need for complex, large language models. This significantly reduces hardware performance requirements and simplifies deployment, allowing for efficient operation in resource-constrained scenarios and achieving high-precision event timeline generation. Furthermore, a precise target user and event filtering mechanism effectively filters out a large number of irrelevant and noisy posts on social media, ensuring that the generated event timeline focuses on truly valuable event information, thus improving the accuracy and relevance of the generated event timeline.

[0145] In addition, by integrating the three social interaction data points of likes, reposts, and comments from all initial event posts, the social interaction characteristics are determined, and a curve is constructed according to the posting time. This allows for the precise extraction of event posts corresponding to peaks in the event's development process. By comprehensively considering the overall trend of the target event's development, all key nodes from the beginning to the end of the event can be captured more comprehensively, resulting in a complete and meaningful event timeline.

[0146] In addition, to extract key event posts more accurately, it is necessary to determine a feature threshold based on social interaction characteristics. This allows for further filtering of event posts corresponding to peaks, removing those with social interaction characteristics below the feature threshold. This effectively identifies and retains truly influential event posts, ensuring that the final event timeline more accurately reflects the development of events and their social impact.

[0147] In addition, a small model is used to perform semantic similarity filtering on the rewritten summary text to remove redundant text with the same semantics, thereby improving the simplicity and readability of the final generated event timeline.

[0148] Corresponding to the above method, the present invention also provides a network event context generation apparatus, which includes a computer device, the computer device including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus implements the steps of the network event context generation method as described above.

[0149] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned network event context generation method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.

[0150] This invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the aforementioned network event context generation method.

[0151] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0152] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0153] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0154] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating network event context, characterized in that, The method includes the following steps: Obtain at least one post from a target user regarding a target event and its corresponding posting time from multiple online platforms; The event post is input into a pre-trained language model to obtain a vector representation of each word element; Extract the extractable summary corresponding to each of the event posts, and add sentence identifiers to the summary sentences in the extractable summary in order; Based on semantic matching, the summary sentence is associated and matched with the event sentences in each of the event posts, and the sentence identifier of the summary sentence corresponding to the lexical tag in the event sentence is used as a group tag; The group token of each word is vectorized to obtain the corresponding group token embedding, and then combined with the vector representation of each word to obtain the word representation; The token representations of each token in each event post are input into a preset context rewriter, and the rewritten summary text of each event post is output; the context rewriter is a decoder based on the Transformer architecture; The rewritten summary text is semantically similar and sorted according to the publication time to obtain the event context corresponding to the target event.

2. The method according to claim 1, characterized in that, The step of obtaining at least one event post and its corresponding posting time from a target user regarding a target event across multiple network platforms includes: Based on the event identifier of the target event and the user identifier of the target user, the initial event post, the social interaction data corresponding to the initial event post, and the posting time are obtained by filtering from the multiple network platforms. Based on the social interaction data and the pre-assigned weights for each piece of social interaction data, the social interaction features corresponding to each initial event post are calculated using a weighted average. The initial event posts are sorted according to their posting times, and a curve is constructed with the corresponding social interaction features as the dependent variable. The initial event post corresponding to the peak in the curve is retained to obtain the at least one event post.

3. The method according to claim 2, characterized in that, After retaining the initial event post corresponding to the peak in the curve to obtain the at least one event post, the method further includes: The feature threshold is obtained by multiplying the mean of the social interaction features corresponding to the initial event post by a preset coefficient. The retained event posts are further filtered using the aforementioned feature threshold, retaining event posts whose social interaction characteristics are greater than the aforementioned feature threshold.

4. The method according to claim 1, characterized in that, The training process of the context rewriter includes: Acquire sample training data; the sample training data includes sample text and corresponding sample summaries; the word units in the sample text are marked with group tags; The group tokens of each word in the sample text are vectorized to obtain the corresponding group token embeddings, and then combined with the vector representations corresponding to each word to obtain the sample word representations. The sample lexical representations are input into the initial Transformer model to obtain the rewritten results; The rewriting result and the sample summary are input into a preset loss function to obtain the loss result; The parameters of the initial Transformer model are iterated using the loss result until the model converges, thus obtaining the context rewriter.

5. The method according to claim 1, characterized in that, The semantic similarity filtering of the rewritten summary text includes: The rewritten summary text is input into a pre-trained semantic similarity model in the form of text pairs, and a similarity label is output. The similarity label is used to indicate the semantic similarity of the input text pairs. The semantic similarity model includes an input embedding layer, an output encoding layer, and an angle difference acquisition layer. The input embedding layer is used to receive the input text pairs and generate the real part embedding and the imaginary part embedding corresponding to each word in the text pair. The output encoding layer is used to input the real part embedding and the imaginary part embedding into the pre-trained language model to obtain the encoded output. The angle difference acquisition layer is used to construct the complex representation of the input text pairs based on the encoded output, calculate the angle difference between the two complex representations through complex number division, and determine the similarity label of the input text pairs. The similarity label indicates that text pairs with the same semantics will be selectively retained.

6. The method according to claim 5, characterized in that, The pre-training process of the semantic similarity model includes: Acquire training data; the training data includes sample text pairs and corresponding sample similarity labels; the sample text pairs include positive sample text pairs and negative sample text pairs; The sample text pairs are input into the initial semantic similarity model to obtain the training results; The training results and the sample similarity labels are input into a preset loss function to obtain the loss result; the preset loss function includes an angle target loss function and a supervised contrastive learning target loss function; Based on the loss result, the initial semantic similarity model is iteratively trained and the model parameters are updated until the model converges to obtain the semantic similarity model.

7. The method according to claim 1, characterized in that, The semantic similarity filtering of the rewritten summary text includes: The rewritten summary text is input into the pre-trained language model to obtain a vector representation corresponding to each rewritten summary text; Based on the vector representation of each rewritten summary text and a preset similarity algorithm, the similarity between each pair of rewritten summary texts is determined; The similarity between each rewritten summary text pair is compared with a preset similarity threshold, and the text in the rewritten summary text pair with a similarity greater than the preset similarity threshold is selected and retained.

8. A network event context generation device, comprising a processor, a memory, and a computer program / instructions stored in the memory, characterized in that, The processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 7.

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