Social media event detection model training method and device, medium and equipment

By constructing and updating information isomorphism graphs, combined with natural language processing and loss function training models, we solve the problems of rapid changes and noise interference in social media event detection technology, and achieve efficient, accurate event detection and adaptability.

CN118606567APending Publication Date: 2024-09-06INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410707151.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing social media event detection technology is difficult to quickly and accurately detect rapidly changing events on social media, and is easily interfered by noise and irrelevant information. Traditional methods are not adaptable to the dynamically changing social media environment.

Method used

By constructing a heterogeneous social network graph, converting it into a message passing graph, forming an information isomorphic graph, regularly updating and aggregating redundant nodes, using natural language processing models to predict emotions and filtering nodes, combining triplet loss functions and global local pair losses Function to perform model training and obtain a converged social media event detection model.

Benefits of technology

It improves the efficiency and accuracy of social media event detection, adapts to the changing social media environment, reduces the impact of noise and redundant information, and enhances the adaptability and reliability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606567A
    Figure CN118606567A
Patent Text Reader

Abstract

The invention provides a social media event detection model training method and device, a medium and equipment. The method comprises the following steps: acquiring a social media information stream generated in a preset historical time period; preprocessing each message to obtain a key vocabulary of the message; taking the key vocabulary, the source user and the event tag of each message as attributes of the message; constructing a heterogeneous social network graph corresponding to the social media information stream; converting the heterogeneous social network graph into a message passing graph capable of highlighting association between messages; constructing a message feature vector corresponding to each message; combining into an information identical composition corresponding to the social media information stream; newly added information streams are obtained regularly, the information isomorphic composition is updated, and aggregation processing is carried out on neighborhood repetitive nodes in the information isomorphic composition after updating; and performing model training by using the information and composition after aggregation processing. The model obtained by training can improve the detection efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart home appliance technology, and in particular to a social media event detection model training method, device, medium, and equipment. Background Art

[0002] Social media platforms, such as Zhihu, Weibo and WeChat, are becoming more and more important in our lives. With the popularity of smartphones and the lower cost of Internet access, people are increasingly sharing important events around them on social media. In the fast-paced digital age, it is crucial to capture these events in a timely manner, not only to provide us with early warnings of various situations, but also to better understand the public's views and reactions to these events. Unlike traditional media such as television and newspapers, the content on social media is generated by users themselves, and the content is updated quickly and the amount of information is huge. This means that important information is sometimes drowned out by the vast amount of information.

[0003] Social media event detection models are a critical tool in the modern online world, helping us discover and focus on hot events on the Internet, whether it is breaking news, natural disasters or protests. Social media event detection models use advanced technologies such as graph neural networks and machine learning to organize chaotic information flows into clear stories. Although there have been many studies that have made progress in social media event detection, solving problems such as language differences, simple and unstructured content, and interrelated events, there are still some challenges to face:

[0004] 1. Data volume and speed: Social media platforms generate a large amount of data, which is updated very quickly. This requires event detection technology to detect events quickly while ensuring accuracy.

[0005] 2. Dynamic changes of events: Events on social media will continue to change over time, such as changes in keywords, tags, and context. Traditional detection methods that rely on fixed patterns or static models are not applicable to the ever-changing social media environment.

[0006] 3. Noise and irrelevant information: The dynamic nature of social media often leads to a lot of noise and irrelevant information, as well as false alarms. Summary of the invention

[0007] In response to at least one of the above technical problems, an embodiment of the present invention provides a social media event detection model training method, device, medium, and equipment.

[0008] According to the first aspect, the social media event detection model training method provided by the embodiment of the present invention includes:

[0009] Acquire a social media information stream generated within a preset historical time period; wherein the social media information stream includes a plurality of messages and an event tag set for each message;

[0010] Pre-process each message to obtain the key words of the message;

[0011] The key words, source users and event tags of each message are used as the attributes of the message;

[0012] According to the attributes of each message, a heterogeneous social network graph corresponding to the social media information flow is constructed; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected;

[0013] Converting the heterogeneous social network graph into a message passing graph capable of highlighting the relationship between messages;

[0014] Construct a message feature vector corresponding to each message;

[0015] Combining each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow;

[0016] Regularly acquiring new information flows, updating the information isomorphism graph according to the new information flows, and aggregating the neighborhood repeated nodes in the information isomorphism graph after the update;

[0017] The information isomorphism graph after aggregation is used for model training to obtain a converged social media event detection model.

[0018] In one embodiment, the preprocessing of each message to obtain key words of the message includes:

[0019] Remove URLs, stop words and preset characters from every message;

[0020] After the deletion operation, vocabulary extraction is performed and entities are identified using named entity recognition technology;

[0021] Reducing the extracted words and identified entities to their basic forms using applied stemming techniques;

[0022] The words and entities restored to their basic forms are used as the key words, and each key word is converted into a corresponding word vector, so as to represent the corresponding key word through the word vector;

[0023] And / or, constructing a message feature vector corresponding to each message includes:

[0024] Obtain the timestamp corresponding to each message and convert the timestamp into a time vector;

[0025] Determine the vocabulary vector corresponding to the key words in each message;

[0026] The time vector and vocabulary vector of each message are used to form the message feature vector corresponding to the message.

[0027] In one embodiment, converting the heterogeneous social network graph into a message passing graph capable of highlighting the relationship between messages includes:

[0028] The heterogeneous social network graph is converted into the message passing graph using a first calculation formula; wherein the first formula is:

[0029]

[0030] Where k represents the node type, o is the key word, e is the event label, u is the source user; i and j are the message numbers; W mk is a matrix formed by the representation data of each node of node type k in the heterogeneous social network graph, [.] T represents the matrix transpose, A ij It is a subgraph formed by the node of the i-th message and the node of the j-th message in the message passing graph.

[0031] In one embodiment, the step of aggregating the neighboring duplicate nodes in the information isomorphism graph after updating includes:

[0032] The second calculation formula is used to perform the l+1th aggregation processing on the neighborhood repeated nodes in the information isomorphism graph; wherein the second calculation formula is:

[0033]

[0034] in, is the set formed by all neighboring nodes of the node corresponding to the i-th message, m j is the node corresponding to the jth message in the set, Indicates aggregation processing, || head Indicates the head concatenation operation, is the representation data after the l-th aggregation processing of the neighborhood repeated nodes of the node corresponding to the j-th message, For use from The relevant feature data is captured in the Aggregator(), and the Aggregator() is used to average the relevant feature data captured from the representation data of each neighborhood node in the set. It is the representation data after the (l+1)th aggregation processing is performed on the neighborhood repeated nodes of the i-th message.

[0035] In one embodiment, before updating the information isomorphism graph according to the newly added information flow, the method further includes:

[0036] The natural language processing model is used to predict the message sentiment corresponding to each message, and the corresponding prediction confidence is output; if the prediction confidence corresponding to a message is lower than a preset threshold, the node corresponding to the message is deleted from the information isomorphism graph;

[0037] And / or, the method of using the information isomorphism graph after aggregation processing to perform model training includes:

[0038] In each training process, model training is performed using small batches of graph data in the information isomorphism graph after aggregation processing until training is completed using all small batches of graph data in the information isomorphism graph after aggregation processing; wherein, the small batch graph data is node data of a predicted number of messages in the information isomorphism graph after aggregation processing, and the preset number is a portion of the number of messages in the information isomorphism graph.

[0039] In one embodiment, the social media event detection model is used to: after detecting multiple social media events based on an input social media information stream, cluster the multiple social media events to obtain event clusters, and output the event clusters.

[0040] In one embodiment, the method further comprises:

[0041] During the training process, the preset loss function is used to calculate the total loss value of each training iteration process, and whether to end the training iteration process is determined according to the total loss value.

[0042] Wherein, the preset loss function includes:

[0043]

[0044]

[0045]

[0046] in, is the total loss value, is the triple loss value, is the global-local pair loss value, D() is the calculation formula of the Euclidean distance, a is the hyperparameter that controls the minimum distance between negative and positive messages, T represents the triple sequence selected in real time, and m i is the i-th message, m i+1 is the positive message of the i-th message, m i-1 is the negative message of the i-th message, is m i The characterization data, is m i-1 The characterization data, is m i+1 Characterization data of

[0047] Where N is the number of messages; S(·) is a bilinear scoring function used to extract the probability of two operands in the joint distribution; s is the average value of the representation data of all messages, for A noise-processed version of .

[0048] According to a second aspect, a social media event detection model training device provided by an embodiment of the present invention includes:

[0049] An information flow acquisition module is used to acquire social media information flows generated within a preset historical time period; wherein the social media information flows include multiple messages and event tags set for each message;

[0050] A preprocessing module is used to preprocess each message to obtain the key words of the message;

[0051] An attribute determination module, used for taking the key words, source users and event tags of each message as the attributes of the message;

[0052] A graph construction module, for constructing a heterogeneous social network graph corresponding to the social media information flow according to the attributes of each message; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected;

[0053] A graph conversion module, used to convert the heterogeneous social network graph into a message passing graph capable of highlighting the association between messages;

[0054] A vector construction module is used to construct a message feature vector corresponding to each message;

[0055] A graph combination module, used to combine each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow;

[0056] A graph updating module, used to periodically acquire new information flows, update the information isomorphic graph according to the new information flows, and aggregate the neighborhood repeated nodes in the information isomorphic graph after the update;

[0057] The model training module is used to perform model training using the information isomorphism graph after aggregation processing to obtain a converged social media event detection model.

[0058] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0059] According to a fourth aspect, an embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0060] The social media event detection model training method, device, medium, and equipment provided by the embodiment of the present invention obtain the social media information flow generated in a preset historical time period, and then pre-process each message in the social media information flow to obtain the key words of the message. The noise in the message can be removed by pre-processing. Then, the key words, source users, and event tags of each message are used as the attributes of the message, and then according to the attributes of each message, a heterogeneous social network graph corresponding to the social media information flow is constructed. In the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute values ​​in different messages are connected. In order to better reflect the association between messages, the heterogeneous social network graph is converted into a message passing graph. Then, a message feature vector corresponding to each message is constructed, so that each message feature vector corresponding to each message and the message passing graph are combined into an information isomorphism graph corresponding to the social media information flow. The information isomorphism graph reflects the association between messages and the message features. Then, the newly added information flow is obtained regularly, and the information isomorphism graph is updated according to the newly added information flow. After the update, the neighborhood repeated nodes in the information isomorphism graph are aggregated to avoid the influence of redundant nodes on subsequent training and reduce the occurrence of false alarms. Finally, the information isomorphism graph after aggregation can be used for model training to obtain a converged social media event detection model. It can be seen that in the above process, by constructing a heterogeneous social network graph and converting it into a message passing graph, an information isomorphism graph is formed. This method can capture the association between nodes and message features, so it can effectively screen and select key information, which is conducive to the trained model to detect social media time in a timely manner, thereby improving the efficiency of identifying events. In addition, removing noise and redundant nodes in the above process can avoid the interference of some useless information on detection, so the accuracy of identifying events can be improved. By regularly updating the information isomorphism graph, the information isomorphism graph can change with the changes in social media information, further improving the ability of the trained model to be applicable to the ever-changing social media environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a process of a social media event detection model training method in one embodiment of the present invention;

[0062] Figure 2 This is a structural block diagram of a social media event detection model training device in an embodiment of the present invention. Detailed implementation manners

[0063] In a first aspect, an embodiment of the present invention provides a method for training a social media event detection model. Refer to Figure 1 , the method includes the following steps S110 to S190:

[0064] S110. Obtain the social media information flow generated within a preset historical time period; wherein, the social media information flow includes a plurality of messages and event tags set for each message;

[0065] Among them, event tags, for example, fire, attack, etc.

[0066] S120. Preprocess each message to obtain the keyword vocabulary of the message;

[0067] It can be understood that through preprocessing, the irrelevant noise and information in the message can be removed.

[0068] In one embodiment, the preprocessing of each message in S120 to obtain the keyword vocabulary of the message may include S121 to S124:

[0069] S121. Delete the website links, stop words, and preset characters in each message;

[0070] Among them, social media messages often contain website links, which are not helpful for analyzing the message content, so they need to be removed.

[0071] Among them, stop words are like words such as "of", "is", "in" in the language. They are very common but not very helpful for understanding the meaning of the sentence, so they will also be removed.

[0072] Among them, preset characters, that is, special characters, such as emoticons or some uncommon symbols, may interfere with the analysis of the message, so they are also removed.

[0073] S122. Extract vocabulary after the deletion operation, and use named entity recognition technology to recognize entities;

[0074] That is, find out those important words in the message, which can help us understand the main content of the post.

[0075] Among them, named entity recognition technology can recognize entities such as person names, place names, and organization names in the message, which helps us understand the main characters and locations in the message, etc.

[0076] S123, using stemming technology to restore the extracted words and identified entities to basic forms;

[0077] Among them, the application of stemming technology can transform the vocabulary back to its basic form, such as transforming "running" back to "run".

[0078] S124: The words and entities restored to their basic forms are used as the key words, and each key word is converted into a corresponding word vector, so as to represent the corresponding key word through the word vector.

[0079] Among them, the key words are in text form, and the vector space model can be used to convert the key words in text form into vector form, that is, to represent the key words by vectors.

[0080] Through S121 to S124, the originally disorganized social media messages are transformed into organized and useful information, laying the foundation for the next step of analysis.

[0081] S130, taking the key words, source user and event tag of each message as the attributes of the message;

[0082] Among them, the source user is the user who publishes the message, and the user is represented in the form of a vector.

[0083] Among them, event labels are also represented in the form of vectors.

[0084] It can be seen that a message has three attributes: one is the key words in the message content, one is the source user, and one is the event label.

[0085] S140, constructing a heterogeneous social network graph corresponding to the social media information flow according to the attributes of each message; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected;

[0086] Understandably, during the data preparation phase, our goal is to use the data as efficiently as possible. We want to extract the important parts from each message and then organize this information in a logical way so that it is ready for subsequent analysis. To do this, we can form a heterogeneous social network graph.

[0087] For example, there are a bunch of articles, each of which is made up of different parts, such as keywords, names, places, etc. Our job is to organize this information, just like putting different puzzle pieces together. Take each part of an article as a node, thus forming a node network of the article, and then splice the node networks of each article together to form the overall network of these articles.

[0088] In the embodiment of the present invention, the key words in each message are taken as a node, the source user is taken as a node, and the event tag is taken as a node, thus forming a network of the message. For example, the event tag of message 1 is fire, and the event tag of message 3 is also fire, so the node of the event tag of message 1 is connected to the node of the event tag of message 3, and in this way, the connection between nodes with the same attribute values ​​in different messages is realized. By connecting nodes with the same attribute values ​​in different messages, a heterogeneous social network graph can be obtained.

[0089] In a heterogeneous social network graph, each node identifies which message it belongs to and the node type. The node type includes three types: keywords, event labels, and source users.

[0090] It can be seen that the heterogeneous social network graph contains every attribute of each message and the relationship between them. The heterogeneous social network graph not only helps us understand the content of each message, but also helps us understand the connection between different messages.

[0091] S150, converting the heterogeneous social network graph into a message transfer graph capable of highlighting the relationship between messages;

[0092] It is understandable that heterogeneous social network graphs usually focus on integrating different types of nodes to capture information. This is like being in a diverse community where everyone has different backgrounds and characteristics. However, for model training, it is more necessary to focus on the connection between different messages rather than simply emphasizing the characteristics of each node. For this reason, in an embodiment of the present invention, the heterogeneous social network graph is converted into a message passing graph, which can better reflect the relationship between messages.

[0093] In a message passing diagram, it is easier to see how the messages flow.

[0094] In one embodiment, in S150, converting the heterogeneous social network graph into a message passing graph capable of highlighting the relationship between messages may include:

[0095] The heterogeneous social network graph is converted into the message passing graph using a first calculation formula; wherein the first formula is:

[0096]

[0097] Where k represents the node type, o is the key word, e is the event label, u is the source user; i and j are the message numbers; W mk is a matrix formed by the representation data of each node of node type k in the heterogeneous social network graph, [.] T represents the matrix transpose, A ijIt is a subgraph formed by the node of the i-th message and the node of the j-th message in the message passing graph.

[0098] Among them, when the i-th message m i The node and the j-th message m j When the nodes are connected, will have a value of at least 1, and A i,j The value of will also be 1.

[0099] By performing conversion through the above first calculation formula, it can be ensured that the converted message passing graph can also retain the original connection between the messages.

[0100] S160, constructing a message feature vector corresponding to each message;

[0101] In one embodiment, constructing a message feature vector corresponding to each message in S160 may include S161 to S163:

[0102] S161. Obtain a timestamp corresponding to each message, and convert the timestamp into a time vector;

[0103] Specifically, the timestamp can be encoded, and the encoded data can be converted into an OLE date, and then a time vector can be generated according to the OLE date. Among them, the OLE date is a time representation method used in OLE automation and component object model (COM). It is a double-precision floating point number. This representation method of OLE date enables the timestamp to be easily converted and operated with date and time in different programming environments.

[0104] S162, determining the vocabulary vector corresponding to the key words in each message;

[0105] For example, the lexical vectors corresponding to each key word in each message are averaged to obtain the average lexical vector corresponding to the message.

[0106] S163. The time vector and vocabulary vector of each message are used to form a message feature vector corresponding to the message.

[0107] For example, the average vocabulary vector and time vector of a message are connected to form the message feature vector. It can be seen that the message feature vector of a message includes two parts of information: one is the information corresponding to the key words, and the other is the time information.

[0108] S170, combining each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow;

[0109] For example, the information isomorphism graph is represented as: G = (X, A), where X is the set of message feature vectors of N messages, A is the graph data corresponding to the N messages in the message transmission graph, and N is the number of messages in the social media information flow generated within a preset historical time period.

[0110] S180, regularly acquiring new information flows, updating the information isomorphism graph according to the new information flows, and aggregating the neighborhood repeated nodes in the information isomorphism graph after the update;

[0111] It is understandable that since new message streams are constantly generated, new information streams will be obtained regularly, and the new information streams will be processed according to the above steps. The nodes corresponding to each message in the new information stream will be added to the existing information isomorphism graph to achieve the addition of new nodes, and the nodes in the new nodes with the same attribute values ​​as the existing nodes will be connected, thereby achieving regular updating of the information isomorphism graph.

[0112] In one embodiment, the step of aggregating the neighboring duplicate nodes in the information isomorphic graph after updating in S180 includes:

[0113] The second calculation formula is used to perform the l+1th aggregation processing on the neighborhood repeated nodes in the information isomorphism graph; wherein the second calculation formula is:

[0114]

[0115] in, is the set formed by all neighboring nodes of the node corresponding to the i-th message, m j is the node corresponding to the jth message in the set, Indicates aggregation processing, || head Indicates the head concatenation operation, is the representation data after the l-th aggregation processing of the neighborhood repeated nodes of the node corresponding to the j-th message, Used from The relevant feature data is captured in the Aggregator(), and the Aggregator() is used to average the relevant feature data captured from the representation data of each neighborhood node in the set. It is the representation data after the (l+1)th aggregation processing is performed on the neighborhood repeated nodes of the i-th message.

[0116] It can be seen that through the above second calculation formula, it is possible to merge duplicate nodes of each message node with neighboring nodes, implement aggregation processing, remove redundant nodes, and help to correctly learn semantics and structure.

[0117] S190. Use the information isomorphism graph after aggregation processing to perform model training and obtain a converged social media event detection model.

[0118] That is to say, after S180, an information isomorphism graph after aggregation processing is obtained, and model training is performed based on the information isomorphism graph to obtain the required social media event detection model.

[0119] In one embodiment, before updating the information isomorphism graph according to the newly added information flow, the method may further include:

[0120] A natural language processing model is used to predict the message sentiment corresponding to each message, and the corresponding prediction confidence is output; if the prediction confidence corresponding to a message is lower than a preset threshold, the node corresponding to the message is deleted from the information isomorphism graph.

[0121] It is understandable that there is a lot of information on social media, but not all of it is helpful for us to detect events. By discarding irrelevant messages, the computing time can be reduced and the accuracy of event detection can be improved. However, the additional step of node filtering will also increase the complexity and require more resources. Selecting filtering criteria is a very challenging task and requires expertise or experiments to find the best method. In an embodiment of the present invention, through sentiment prediction, the confidence level at the time of prediction is used to filter the nodes, so that the nodes can be effectively filtered.

[0122] Among them, the natural language processing model can use the DistilBERT model. DistilBERT is a simplified version of the BERT model, which can quickly process large amounts of data and understand text content in real time. BERT is a language representation model, and BERT stands for Bidirectional Encoder Representations from Transformers.

[0123] A natural language processing model was initially trained on a dataset of text messages, enabling it to make sentiment predictions about messages, with the model assigning a confidence score indicating the certainty of its prediction.

[0124] The preset threshold is, for example, 50%. When the confidence of the sentiment prediction of a message is lower than 50%, the node of the message is deleted from the information isomorphism graph.

[0125] It is understandable that node filtering using sentiment analysis can be used to mine communities, influencers, or topics of interest in social network analysis by understanding the emotional tone of messages. Combining sentiment filtering provides a more detailed and informative graph representation based on emotional content.

[0126] In one embodiment, the model training using the information isomorphism graph after aggregation processing in S190 may include:

[0127] In each training process, model training is performed using small batches of graph data in the information isomorphism graph after aggregation processing until training is completed using all small batches of graph data in the information isomorphism graph after aggregation processing; wherein, the small batch graph data is node data of a predicted number of messages in the information isomorphism graph after aggregation processing, and the preset number is a portion of the number of messages in the information isomorphism graph.

[0128] It is understandable that since there are so many nodes in the information isomorphism graph, the entire information isomorphism graph is very large. If the information isomorphism graph is used directly for model training, the efficiency is very low. Therefore, the overall graph data of the entire information isomorphism graph is divided into multiple small batches of graph data. For example, the entire information isomorphism graph includes graph data of 10,000 messages, and each small batch of graph data includes graph data of 100 messages. The first round of training uses the graph data of the first 100 messages, and the second round of training uses the graph data of the second 100 messages, ..., until the 100th round of training uses the graph data of the 100th 100 messages. It can be seen that using small batches of graph data for training allows the model to be extended to the entire information isomorphism graph.

[0129] In one embodiment, the method provided by the embodiment of the present invention may further include:

[0130] During the training process, the preset loss function is used to calculate the total loss value of each training iteration process, and whether to end the training iteration process is determined according to the total loss value.

[0131] Wherein, the preset loss function includes:

[0132]

[0133]

[0134]

[0135] in, is the total loss value, is the triple loss value, is the global-local pair loss value, D() is the calculation formula of the Euclidean distance, a is the hyperparameter that controls the minimum distance between negative and positive messages, T represents the triple sequence selected in real time, and m i is the i-th message, m i+1 is the positive message of the i-th message, m i-1 is the negative message of the i-th message, is m iThe characterization data, is m i-1 The characterization data, is m i+1 Characterization data of

[0136] Where N is the number of messages; S(·) is a bilinear scoring function used to extract the probability of two operands in the joint distribution; s is the average value of the representation data of all messages, for A noise-processed version of .

[0137] Event detection in social media occurs in a dynamic data stream, where new unseen events appear, making the cross entropy loss inapplicable. So the triplet loss is adopted, which requires a triplet consisting of an anchor, a positive sample, and a negative sample. The triplet loss is an optimization algorithm that tries to ensure that the distance between the anchor and the positive sample is smaller than the distance between the anchor and the negative sample. The anchor message is an instance at the beginning of the learning process, which serves as a reference point around which other instances can be compared. The positive sample is the positive message, and the negative sample is the parent message. We focus on the distance between the anchor message and the negative message, which must be smaller than the distance between the anchor message and the positive message. In other words, because the use of the triplet loss leads to faster convergence and the dataset is semi-supervised during training, our goal is to minimize the internal distance of the dataset rather than the mutual distance between the datasets. The triplet loss function helps discover new event categories in dynamic news streams where the total number of social event categories is unknown.

[0138] In order to take into account the characteristics of the graph, the global local pair loss is used here, which enables the social media event detection model to identify and maintain the properties of similar local structures. The global local pair loss is developed based on the noise construction principle and aims to maximize the mutual information by reducing the cross entropy between the local representation and the aggregation of the entire information isomorphic graph.

[0139] Our goal is to measure the similarity between two probability distributions: one representing the expected distribution and the other representing the actual distribution. Cross entropy is a tool to achieve this goal and it is very useful in communication over dynamic graphs. In simple terms, cross entropy helps us understand the difference between the predicted message and the true message. During training, gradient-based optimization techniques are used to reduce this difference.

[0140] During the training process, small batches of graph data are used for training, which enables the model to handle large message graphs. In each small batch of graph data, a The triple instance used in . Similarly, Related parameters in Since the model is incremental, it is not trained once but continuously. This means that the model needs to be updated regularly with the latest data to ensure that it is always up to date.

[0141] During the maintenance phase of the model, the model is trained using recently received data instead of starting from scratch each time. This training method does not require complete label information because we can extract samples from labeled messages and then use the samples to calculate Even if some messages are unlabeled, they are still useful because their features and structural information can be incorporated into labeled data through the propagation mechanism of the model. When calculating the global-local pair loss, label information is actually not required, which is particularly helpful for processing social media data streams that are only partially labeled.

[0142] The total loss function is the sum of the triplet loss function and the global-local pairwise loss function. When detecting events in social media information streams, it is critical to accurately tune the model's algorithm. One important step is to deal with hard negative samples, which are messages that are mistakenly identified as events by the model, although in fact they are not relevant and may be just some noise. Our goal is to reduce such mislabeling. By excluding these misleading data during the training process, the model is guided to focus on those clear and true event instances. The purpose of this is to allow the model to learn to more accurately identify truly important events. By removing these potentially misleading samples, the model's ability to identify and learn to predict major events is improved. This ultimately enhances the accuracy and reliability of the model in early detection of events in the real world, making it a more powerful and trustworthy tool.

[0143] It can be seen that in the maintenance phase of the model, the latest data is used to update the model. The hard negative samples marked during the training process are removed, that is, those samples that are incorrectly marked as events by the model, to improve the accuracy and reliability of the model. Finally, performance indicators such as standard mutual information and adjusted mutual information can be used to evaluate the model, and parameters can be adjusted as needed.

[0144] In one embodiment, the social media event detection model may be used to: after detecting multiple social media events based on an input social media information stream, cluster the multiple social media events to obtain event clusters, and output the event clusters.

[0145] That is to say, in the application scenario, the social media information stream is input into the social media event detection model, and the social media event detection model will detect multiple social media events. Before outputting the results, these social media events will be clustered to obtain event clusters, and finally the event clusters will be output.

[0146] There are many clustering methods, for example, distance-based clustering algorithms and density-based clustering algorithms.

[0147] It can be seen that clustering processing and then output is helpful to understand the categories of social media events.

[0148] It is understandable that existing event detection methods often face challenges when dealing with rapidly changing content on social media, such as large amounts of data and fast update speeds. The embodiments of the present invention use graph neural networks (GNNs) to capture changes in user relationships in social media. This method can more effectively screen and select key information, detect and track the development of events in a timely manner, and improve the accuracy and efficiency of identifying major events.

[0149] The method provided by the embodiment of the present invention has the following beneficial effects:

[0150] (1) In view of the fact that traditional event detection methods are difficult to adapt to the huge amount of social media event data, the high noise content, and the dynamic changes of new events, the embodiments of the present invention preprocess the social media information flow, filter the noise, and improve the ability to understand the real-time context and capture the text content of social media. By constructing an information isomorphism graph, the evolving relationships and interactions in the social media network can be captured, so as to detect and track events as they occur and evolve.

[0151] (2) The natural language processing model is used to predict the message sentiment corresponding to each message and output the corresponding prediction confidence. If the prediction confidence corresponding to a message is lower than a preset threshold, the node corresponding to the message is deleted from the information isomorphism graph, thereby discarding irrelevant messages, thereby achieving the purpose of reducing calculation time and improving the accuracy of event detection.

[0152] (3) The total loss function is the sum of the triplet loss function and the global-local pair loss function, that is, the triplet loss and the global-local pair loss are combined to remove these hard negative samples during fitting, thereby improving the model's ability to distinguish and learn major events and improving the model's accuracy and reliability in early event detection.

[0153] (3) In the maintenance phase, the model is updated through incremental learning. That is, the model continues to be trained using the most recently received update data, rather than starting from scratch based on prior knowledge. This allows the model to adapt to the continuous input of new data and dynamically update model parameters, thereby maintaining sensitivity to the latest information. Through this iterative approach, the model can automatically eliminate information that is no longer relevant and retain only the most important data. In this way, the model can become more adept at identifying new events and discover problems at the earliest opportunity.

[0154] (4) Use small batches of graph data during training so that the model can be extended to information-isomorphic graphs, which can improve the convergence speed.

[0155] In summary, the embodiments of the present invention construct a heterogeneous social network graph and then convert it into a message passing graph to form an information isomorphism graph. This method can capture the associations between nodes and message features, so it can effectively screen and select key information, which is conducive to the trained model to detect social media events in a timely manner, thereby improving the efficiency of identifying events. Moreover, by preprocessing to remove noise and redundant nodes, it is possible to avoid interference of some useless information on detection, thereby improving the accuracy of identifying events. By regularly updating the information isomorphism graph, the information isomorphism graph can change with changes in social media information, further improving the ability of the trained model to be applicable to the ever-changing social media environment.

[0156] In a second aspect, an embodiment of the present invention provides a social media event detection model training device, see Figure 2 , the device 100 comprises:

[0157] The information flow acquisition module 110 is used to acquire the social media information flow generated within a preset historical time period; wherein the social media information flow includes multiple messages and an event tag set for each message;

[0158] A preprocessing module 120 is used to preprocess each message to obtain key words of the message;

[0159] An attribute determination module 130, for taking the key words, source user and event tag of each message as the attributes of the message;

[0160] A graph construction module 140 is used to construct a heterogeneous social network graph corresponding to the social media information flow according to the attributes of each message; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected;

[0161] A graph conversion module 150, configured to convert the heterogeneous social network graph into a message passing graph capable of highlighting the association between messages;

[0162] A vector construction module 160, used to construct a message feature vector corresponding to each message;

[0163] A graph combining module 170, configured to combine each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow;

[0164] A graph updating module 180, configured to periodically acquire new information flows, update the information isomorphism graph according to the new information flows, and aggregate the neighborhood duplicate nodes in the information isomorphism graph after the update;

[0165] The model training module 190 is used to perform model training using the information isomorphism graph after aggregation processing to obtain a converged social media event detection model.

[0166] In one embodiment, the preprocessing module is specifically used to: delete URL links, stop words and preset characters in each message; perform vocabulary extraction after the deletion operation, and identify entities using named entity recognition technology; use stemming technology to restore the extracted vocabulary and identified entities to basic forms; use the vocabulary and entities restored to basic forms as the key words, and convert each key word into a corresponding vocabulary vector to represent the corresponding key word through the vocabulary vector.

[0167] In one embodiment, the vector construction module is specifically used to: obtain the timestamp corresponding to each message and convert the timestamp into a time vector; determine the vocabulary vector corresponding to the key words in each message; and form a message feature vector corresponding to the message using the time vector and vocabulary vector of each message.

[0168] In one embodiment, the graph conversion module is specifically used to: convert the heterogeneous social network graph into the message passing graph using a first calculation formula; wherein the first formula is:

[0169]

[0170] Where k represents the node type, o is the key word, e is the event label, u is the source user; i and j are the message numbers; W mk is a matrix formed by the representation data of each node of node type k in the heterogeneous social network graph, [.] T represents the matrix transpose, A ij It is a subgraph formed by the node of the i-th message and the node of the j-th message in the message passing graph.

[0171] In one embodiment, the graph updating module is specifically used to: perform the l+1th aggregation process on the neighborhood repeated nodes in the information isomorphic graph using a second calculation formula; wherein the second calculation formula is:

[0172]

[0173] in, is the set formed by all neighboring nodes of the node corresponding to the i-th message, m jis the node corresponding to the jth message in the set, Indicates aggregation processing, || head Indicates the head concatenation operation, is the representation data after the l-th aggregation processing of the neighborhood repeated nodes of the node corresponding to the j-th message, Used from The relevant feature data is captured in the Aggregator(), and the Aggregator() is used to average the relevant feature data captured from the representation data of each neighborhood node in the set. It is the representation data after the (l+1)th aggregation processing is performed on the neighborhood repeated nodes of the i-th message.

[0174] In one embodiment, before updating the information isomorphism graph according to the newly added information flow, the graph update module is also used to: use a natural language processing model to predict the message sentiment corresponding to each message, and output the corresponding prediction confidence; if the prediction confidence corresponding to a message is lower than a preset threshold, the node corresponding to the message is deleted from the information isomorphism graph.

[0175] In one embodiment, the model training module is specifically used to: perform model training using small batch graph data in the information isomorphism graph after aggregation processing in each training process until the training is completed using all small batch graph data in the information isomorphism graph after aggregation processing; wherein, the small batch graph data is node data of a predicted number of messages in the information isomorphism graph after aggregation processing, and the preset number is a portion of the number of messages in the information isomorphism graph.

[0176] In one embodiment, the social media event detection model is used to: after detecting multiple social media events based on an input social media information stream, cluster the multiple social media events to obtain event clusters, and output the event clusters.

[0177] In one embodiment, the model training module is further used to: calculate the total loss value of each training iteration process using a preset loss function during the training process, and determine whether to end the training iteration process according to the total loss value, wherein the preset loss function includes:

[0178]

[0179]

[0180]

[0181] in, is the total loss value, is the triple loss value, is the global-local pair loss value, D() is the calculation formula of the Euclidean distance, a is the hyperparameter that controls the minimum distance between negative and positive messages, T represents the triple sequence selected in real time, and m i is the i-th message, m i+1 is the positive message of the i-th message, m i-1 is the negative message of the i-th message, is m i The characterization data, is m i-1 The characterization data, is m i+1 Characterization data of

[0182] Where N is the number of messages; S(·) is a bilinear scoring function used to extract the probability of two operands in the joint distribution; s is the average value of the representation data of all messages, for A noise-processed version of .

[0183] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0184] In a third aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0185] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0186] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0187] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0188] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0189] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0190] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0191] In a fourth aspect, an embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any embodiment of the specification.

[0192] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0193] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0194] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0195] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A social media event detection model training method, characterized in that: include: Acquire a social media information stream generated within a preset historical time period; wherein the social media information stream includes a plurality of messages and an event tag set for each message; Pre-process each message to obtain the key words of the message; The key words, source users and event tags of each message are used as the attributes of the message; According to the attributes of each message, a heterogeneous social network graph corresponding to the social media information flow is constructed; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected; Converting the heterogeneous social network graph into a message passing graph capable of highlighting the relationship between messages; Construct a message feature vector corresponding to each message; Combining each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow; Regularly acquiring new information flows, updating the information isomorphism graph according to the new information flows, and aggregating the neighborhood repeated nodes in the information isomorphism graph after the update; The information isomorphism graph after aggregation is used for model training to obtain a converged social media event detection model.

2. The method according to claim 1, characterized in that The preprocessing of each message to obtain the key words of the message includes: Remove URLs, stop words and preset characters from every message; After the deletion operation, vocabulary extraction is performed and entities are identified using named entity recognition technology; Reducing the extracted words and identified entities to their basic forms using applied stemming techniques; The words and entities restored to their basic forms are used as the key words, and each key word is converted into a corresponding word vector, so as to represent the corresponding key word through the word vector; And / or, constructing a message feature vector corresponding to each message includes: Obtain the timestamp corresponding to each message and convert the timestamp into a time vector; Determine the vocabulary vector corresponding to the key words in each message; The time vector and vocabulary vector of each message are used to form the message feature vector corresponding to the message.

3. The method according to claim 1, characterized in that The converting the heterogeneous social network graph into a message passing graph capable of highlighting the relationship between messages comprises: The heterogeneous social network graph is converted into the message passing graph using a first calculation formula; wherein the first formula is: Where k represents the node type, o is the key word, e is the event label, u is the source user; i and j are the message numbers; W mk is a matrix formed by the representation data of each node of node type k in the heterogeneous social network graph, [.] T represents the matrix transpose, A ij It is a subgraph formed by the node of the i-th message and the node of the j-th message in the message passing graph.

4. The method according to claim 1, characterized in that: The step of aggregating the repeated nodes in the neighborhood of the information isomorphic graph after updating includes: The second calculation formula is used to perform the l+1th aggregation processing on the neighborhood repeated nodes in the information isomorphism graph; wherein the second calculation formula is: in, is the set formed by all neighboring nodes of the node corresponding to the i-th message, is the node corresponding to the jth message in the set, ⊕ represents aggregation processing, ∥ head Indicates the head concatenation operation, is the representation data after the l-th aggregation processing of the neighborhood repeated nodes of the node corresponding to the j-th message, For use from The relevant feature data is captured in the Aggregator(), and the Aggregator() is used to average the relevant feature data captured from the representation data of each neighborhood node in the set. It is the representation data after the (l+1)th aggregation processing is performed on the neighborhood repeated nodes of the i-th message.

5. The method according to claim 1, characterized in that Before updating the information isomorphism graph according to the newly added information flow, the method further includes: The natural language processing model is used to predict the message sentiment corresponding to each message, and the corresponding prediction confidence is output; if the prediction confidence corresponding to a message is lower than a preset threshold, the node corresponding to the message is deleted from the information isomorphism graph; And / or, the method of using the information isomorphism graph after aggregation processing to perform model training includes: In each training process, model training is performed using small batches of graph data in the information isomorphism graph after aggregation processing until training is completed using all small batches of graph data in the information isomorphism graph after aggregation processing; wherein, the small batch graph data is node data of a predicted number of messages in the information isomorphism graph after aggregation processing, and the preset number is a portion of the number of messages in the information isomorphism graph.

6. The method according to claim 1, characterized in that The social media event detection model is used to: after detecting multiple social media events based on an input social media information stream, cluster the multiple social media events to obtain event clusters, and output the event clusters.

7. The method according to claim 1, characterized in that Also includes: During the training process, the preset loss function is used to calculate the total loss value of each training iteration process, and whether to end the training iteration process is determined according to the total loss value. Wherein, the preset loss function includes: in, is the total loss value, is the triple loss value, is the global-local pair loss value, D() is the calculation formula of the Euclidean distance, a is the hyperparameter that controls the minimum distance between negative and positive messages, T represents the triple sequence selected in real time, and m i is the i-th message, m i+1 is the positive message of the i-th message, m i-1 is the negative message of the i-th message, is m i The characterization data, is m i-1 The characterization data, is m i+1 Characterization data of Where N is the number of messages; S(·) is a bilinear scoring function used to extract the probability of two operands in the joint distribution; s is the average value of the representation data of all messages, for A noise-processed version of .

8. A social media event detection model training device, characterized in that: include: An information flow acquisition module is used to acquire social media information flows generated within a preset historical time period; wherein the social media information flows include multiple messages and event tags set for each message; A preprocessing module is used to preprocess each message to obtain the key words of the message; An attribute determination module, used for taking the key words, source users and event tags of each message as the attributes of the message; A graph construction module, for constructing a heterogeneous social network graph corresponding to the social media information flow according to the attributes of each message; in the heterogeneous social network graph, each attribute of each message is used as a node, and nodes with the same attribute value in different messages are connected; A graph conversion module, used to convert the heterogeneous social network graph into a message passing graph capable of highlighting the association between messages; A vector construction module is used to construct a message feature vector corresponding to each message; A graph combination module, used to combine each message feature vector corresponding to each message and the message transfer graph into an information isomorphism graph corresponding to the social media information flow; A graph updating module, used to periodically acquire new information flows, update the information isomorphic graph according to the new information flows, and aggregate the neighborhood repeated nodes in the information isomorphic graph after the update; The model training module is used to perform model training using the information isomorphism graph after aggregation processing to obtain a converged social media event detection model.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Social network event detection method and device

    CN111598710A

  • Social media rumor detection method based on network information propagation graph modeling

    CN112199608A

  • Model parameter adjustment method and device, electronic device and storage medium

    CN113779423A

  • Social network influence prediction method and device based on heterogeneous network

    CN114090902A