Group behavior prediction method based on semantic aggregation, product, medium and equipment
By obtaining and utilizing the contextual information of entities, calculating representations and performing classifier aggregation, the problem of failing to effectively utilize contextual information in the existing technology is solved, and the accuracy and efficiency of group behavior prediction are improved.
Patent Information
- Application Number
- CN202410675520.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-10
AI Technical Summary
Existing technologies fail to effectively utilize context information in group behavior prediction, resulting in reduced accuracy of semantic aggregation and group behavior prediction.
By obtaining the context information of the entity, calculating the context representation and performing linear transformation, combining the Skip Gram method to obtain the entity representation, calculating the final quality score based on the context score and entity score, establishing an entity-set classifier, and performing synonymous entity aggregation and normalization Mapping to improve the accuracy of semantic aggregation.
It improves the accuracy and efficiency of group behavior prediction, reduces the interference information caused by semantic diversification, and enhances the accuracy of synonymous entity aggregation.
Smart Images

Figure CN118626953A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of group behavior, and in particular to a group behavior prediction method, product, medium and device based on semantic aggregation. Background Art
[0002] In recent years, the technology of predicting group behavior has been widely used in many scenarios such as e-commerce, financial assessment, transportation, and public space order maintenance. However, how to improve the accuracy of group behavior prediction is a difficult problem. In the process of solving this problem, the biggest problem faced is how to aggregate behaviors with the same semantics, that is, to achieve semantic aggregation. The key is how to map behaviors with the same semantics but different expressions to the same behavior node to achieve normalization of behaviors, that is, to achieve aggregation of similar behaviors.
[0003] Existing similar behavior aggregation methods mainly start from mining different expressions of entities, using neural networks to fully characterize entity features, and adopt an efficient synonym entity aggregation method. This method first identifies and marks entities that may have the same semantics by training entity synonym relationship classifiers. Then, by applying clustering algorithms, all candidate entities are effectively aggregated. Specifically, the entity synonym relationship classifier is first trained by combining information such as co-occurrence frequency between entities and pre-trained word vectors, and then all candidate entities are aggregated using clustering algorithms to achieve aggregation of synonymous entities. The aggregation process can be summarized into the following two stages: In the first stage, the entity and set relationship is accurately determined by measuring the entity similarity between the entity and the target set. In the second stage, the aggregation algorithm is used to map behaviors with the same semantics but different expressions to the same behavior node, reducing the interference information caused by the diversity of behavior semantics in the behavior sequence. Although this method has achieved certain results in processing entity synonymous relations, it ignores the impact of contextual information on the entity synonymous relationship classifier. This information is crucial to correctly capture entity synonymous relations. Failure to make good use of this information will have a greater impact on the performance of the algorithm, thereby reducing the accuracy of semantic aggregation and thus reducing the accuracy of group behavior prediction. Summary of the invention
[0004] The purpose of the present invention is to provide a group behavior prediction method, product, medium and device based on semantic aggregation, which can improve the accuracy of semantic aggregation based on the context information of entities, thereby effectively improving the accuracy and efficiency of group behavior prediction.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A group behavior prediction method based on semantic aggregation, comprising:
[0007] Obtaining context information of each entity in an entity set and calculating a context representation of each entity; the entity set includes multiple group behavior information;
[0008] Perform a linear transformation on the context representation of each entity to obtain a context representation set and calculate the context score of the context representation set;
[0009] The Skip Gram method is used to obtain the entity representation of each entity in the entity set;
[0010] Perform a linear transformation on the entity representation of each entity to obtain an entity representation set and calculate the entity score of the entity representation set;
[0011] The final quality score of the entity set is calculated based on the context score and the entity score, and the synonymous entity probability between the candidate entity and the entity in the entity set is calculated to obtain the entity-set classifier;
[0012] Perform synonymous entity aggregation on candidate entities according to the entity-set classifier to obtain a list of synonymous entity sets;
[0013] Establish a normalized mapping based on a list of synonymous entity sets;
[0014] Normalizing the original behavior sequence list according to the normalization mapping to obtain a normalized behavior sequence list; the original behavior sequence list includes a plurality of original group behaviors;
[0015] Predict group behavior based on a list of normalized behavior sequences.
[0016] Optionally, the acquiring context information of each entity in the entity set and calculating the context representation of each entity specifically includes:
[0017] Randomly obtain k context sequences of each entity w in the entity set S to form context information p;
[0018] Based on the entity and the context information of the entity, two different LSTM networks are used, respectively through the formula and Perform forward propagation and back propagation to obtain the above representation of the entity and the following characterization in, is the forward propagation function of the LSTM network; is the LSTM network back propagation function; is the vector of the entity corresponding to the tth time step; is the vector of the hidden state at the t-1th time step; is the vector of the hidden state at the t+1th time step;
[0019] Entity-based context representation and the following characterization Using formula Compute the contextual representation of the entity h p .
[0020] Optionally, performing a linear transformation on the context representation of each entity to obtain a context representation set and calculating a context score of the context representation set specifically includes:
[0021] Using the formula h' p =Relu(W2Relu(W1h p )) The context representation h for each entity p Perform a linear transformation to obtain the context representation h' after linear transformation p ; Among them, Relu is the activation function; W1 and W2 are linear transformation matrices;
[0022] The linearly transformed context representation h' of all entities in the entity set p Accumulate and get the context representation set
[0023] Context-based representation collection Using formula Compute context representation set Context Score context ; Among them, W3, W4, and W5 are linear transformation matrices.
[0024] Optionally, performing a linear transformation on the entity representation of each entity to obtain an entity representation set and calculating the entity score of the entity representation set specifically includes:
[0025] Using the formula h' entity =Relu(W7Relu(W6h entity )) For each entity, the entity representation h entity Perform a linear transformation to obtain the entity representation h' after the linear transformation entity ;W6 and W7 are linear transformation matrices;
[0026] The entity representation h' after the linear transformation of all entities in the entity set entity Accumulate and get the entity representation set
[0027] Entity Representation Collection Using formula Computing entity representation sets Entity score Score entity; Among them, W8, W9, W 10 is the linear transformation matrix.
[0028] Optionally, the method of calculating the final quality score of the entity set based on the context score and the entity score, and calculating the synonymous entity probability between the candidate entity and the entity in the entity set, to obtain the entity-set classifier specifically includes:
[0029] Score based on context context and entity score Score entity , using the formula Score = Score context +Score entity Calculate the final quality score Score of the entity set;
[0030] Based on the final quality score Score, the formula is used Calculate the synonymous entity probability between the candidate entity t and the entities in the entity set S Get entity-set classifier Among them, σ is the sigmoid function; is the temporary set S formed after adding the candidate entity t to the entity set S temp The final quality score of S is the final quality score of the entity set S.
[0031] Optionally, the establishing a normalized mapping according to the synonymous entity set list specifically includes:
[0032] Traverse the list of synonymous entity sets, select the entity with the highest frequency in the synonymous entity set as the normalized entity, and establish a normalized mapping.
[0033] A computer program product includes a computer program, which implements the group behavior prediction method based on semantic aggregation when executed by a processor.
[0034] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the group behavior prediction method based on semantic aggregation.
[0035] A computer device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the group behavior prediction method based on semantic aggregation.
[0036] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0037] The present invention provides a method, product, medium and device for predicting group behavior based on semantic aggregation. The method comprises: obtaining context information of each entity in an entity set and calculating context representation of each entity; performing linear transformation on the context representation of each entity to obtain a context representation set and calculating context score of the context representation set; obtaining entity representation of each entity in the entity set by using Skip Gram method; performing linear transformation on the entity representation of each entity to obtain an entity representation set and calculating entity score of the entity representation set; calculating the final quality score of the entity set based on the context score and the entity score, and calculating the synonymous entity probability between the candidate entity and the entity in the entity set to obtain an entity-set classifier; performing synonymous entity aggregation on the candidate entity according to the entity-set classifier to obtain a synonymous entity set list; establishing a normalized mapping of all candidate entities according to the synonymous entity set list; performing normalization processing on the original behavior sequence list according to the normalized mapping to obtain a normalized behavior sequence list; predicting group behavior according to the normalized behavior sequence list. The group behavior prediction method, product, medium and device based on semantic aggregation provided by the present invention can overcome the problem in the prior art that behaviors with the same semantics but different expressions correspond to different behavior nodes, and improve the accuracy of semantic aggregation based on the contextual information of the entity, reduce the interference information caused by semantic diversity, thereby effectively improving the accuracy and efficiency of group behavior prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of the flow of the group behavior prediction method based on semantic aggregation provided by the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The purpose of the present invention is to provide a group behavior prediction method, product, medium and device based on semantic aggregation, which can improve the accuracy of semantic aggregation based on the context information of entities, thereby effectively improving the accuracy and efficiency of group behavior prediction.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Figure 1 The figure is a flow chart of the method for predicting group behavior based on semantic aggregation provided by the present invention. Figure 1 As shown, the group behavior prediction method based on semantic aggregation disclosed in the present invention includes:
[0044] Step 1: Obtain the context information of each entity in the entity set and calculate the context representation of each entity.
[0045] The entity set of the present invention includes a variety of group behavior information, such as commodity classification behavior, browsing behavior, investment behavior, commodity evaluation behavior and other group behaviors.
[0046] The present invention constructs an entity set based on two widely used datasets Wiki and NYT and the Tmall recommendation dataset Rec-Tmall, where:
[0047] 1) Wiki: It contains 100,000 articles from Wikipedia and uses Freebase as the knowledge base to generate a set of synonymous entities for training models.
[0048] 2) NYT: Contains 119,000 news articles from the New York Times and uses Freebase as the knowledge base to generate a set of synonymous entities.
[0049] 3) Rec-Tmall: The Tmall recommendation algorithm competition dataset published by Alibaba Tianchi Data website contains 5,133,507 product information, stored in the form of "product ID, product description, image URL, category ID, brand ID, seller ID". Use crawlers to crawl relevant documents of product descriptions from Baidu Baike, Tencent News, NetEase News, Zhihu and other websites, use JieBa library for word segmentation and part-of-speech tagging, use Harbin Institute of Technology stop word list to remove stop words, filter out nouns in product descriptions, and use Harbin Institute of Technology Synonym Forest and Python Synonyms library as knowledge base to build a synonym entity set.
[0050] Specifically, for an entity set S = {w1, w2, ..., w o}, randomly obtain k context sequences of each entity w in the entity set S to form context information p, and form the context set S of the entity set S based on the context information p of each entity w context ={p1, p2, ..., p o}.
[0051] In order to use the context information p of entity w to measure the semantic similarity between entities in the entity set S, it is necessary to obtain the context representation of each entity. LSTM network is a temporal neural network that is good at sequence information, so the present invention uses LSTM network to represent the context of each entity. Usually the context and the following of an entity are located on the left and right sides of the entity, respectively, and the two have different contributions to the characterization of the entity. Specifically, based on entity w and the context information p of the entity, two different LSTM networks are used to perform bidirectional propagation on the sequence containing entity w and the context information p of the entity, respectively. Forward propagation starts from the first entity in the sequence and stops at the target entity; reverse propagation starts from the last entity in the sequence and stops at the target entity. In the sequence, the closer the entity is to the target entity, the greater its influence. Therefore, the present invention uses a reverse LSTM network to represent the following content so that the obtained following content representation contains more information about the target entity, as follows:
[0052]
[0053] Among them, formula (1) represents the forward propagation of the LSTM network, and formula (2) represents the backward propagation of the LSTM network. is the above representation of the entity, The following representation of the entity. is the forward propagation function of the LSTM network, It is the back propagation function of LSTM network. is the vector corresponding to the entity at the tth time step. is the vector of the hidden state at the t-1th time step, is the vector of the hidden state at the t+1th time step. Since information propagation stops at the target entity, the position information of the entity in the sequence is also considered in the obtained previous and following representations.
[0054] Represent the entity in context With the following characterization Fusion, get the context representation h of the entity p :
[0055]
[0056] Step 2: Perform a linear transformation on the context representation of each entity to obtain a context representation set and calculate the context score of the context representation set.
[0057] Use a nonlinear network to extract the features of the context representation of each entity, that is, perform a linear transformation on the context representation of each entity to obtain the linearly transformed context representation h' p , as follows:
[0058] h' p =Relu(W2Relu(W1h p )) (4)
[0059] Among them, Relu is the activation function; W1 and W2 are linear transformation matrices.
[0060] The linearly transformed context representation h' of all entities in the entity set p Accumulate and get the context representation set
[0061]
[0062] Among them, h' pi is the linearly transformed context representation of the i-th entity in the entity set S.
[0063] Context-based representation collection The context representation set is calculated through the following network Context Score context :
[0064]
[0065] Among them, W3, W4, and W5 are linear transformation matrices.
[0066] Step 3: Use the Skip Gram method to obtain the entity representation of each entity in the entity set.
[0067] Use the Skip Gram method to obtain the entity representation h of each entity in the entity set through the text data in the dataset entity , where the text data and other related statistical data in the dataset are shown in Table 1:
[0068] Table 1 Dataset related statistics
[0069] Dataset NYT Wiki Rec-Tmall Number of documents 118664 100000 109652 Number of sentences 3002123 6839331 2952391 Number of entities in the training set 2600 8731 2952 Number of synonymous entity sets in the training set 1273 4359 1075 Number of test set entities 389 891 412 Number of synonymous entity sets in the test set 117 256 125
[0070] Step 4: Perform a linear transformation on the entity representation of each entity to obtain an entity representation set and calculate the entity score of the entity representation set.
[0071] The entity set scoring network scores the overall similarity of entities in the entity set S by measuring the similarity between each entity in the entity set S, and uses a nonlinear network to extract the features of the entity representation of each entity in the entity set S, that is, the entity representation h of each entity entity Perform a linear transformation to obtain the entity representation h' after the linear transformation entity , as follows:
[0072] h' entity =Relu(W7Relu(W6h entity )) (7)
[0073] Among them, W6 and W7 are linear transformation matrices.
[0074] The entity representation h' after the linear transformation of all entities in the entity set S entity Accumulate and get the entity representation set
[0075]
[0076] Among them, h' entity i is the entity representation of the i-th entity in the entity set S after linear transformation.
[0077] Entity Representation Collection The entity representation set is calculated through the following network Entity score Score entity :
[0078]
[0079] Among them, W8, W9, W 10 is the linear transformation matrix.
[0080] Step 5: Calculate the final quality score of the entity set based on the context score and entity score, and calculate the synonymous entity probability between the candidate entity and the entity in the entity set to obtain the entity-set classifier.
[0081] The context score and entity score obtain the quality score (i.e., score) of the entity set S from the context level and entity level respectively. context With Score entity , superimpose these two quality scores to obtain the final quality score Score of the entity set S:
[0082] Score=Score context +Score entity (10)
[0083] Add the candidate entity t (an entity used to determine whether there is a similar relationship with an entity in the entity set S) to the entity set S to form a temporary set S temp , based on the final quality score Score, input the entity set S and the temporary set S respectively temp , and get the final quality score of the two S and The synonymous entity probability between the candidate entity t and the entities in the entity set S is obtained by the following formula, that is, the entity-set classifier
[0084]
[0085] Where σ is the sigmoid function. Obtain the synonymous entity probability between the candidate entity t and the entities in the entity set S The process is called entity-set classifier The process of classifying candidate entity t is achieved by judging which entity set the candidate entity t has a synonymous relationship with. Greater than Score S , it indicates that the probability that the candidate entity t is synonymous with the entities in the entity set S is high.
[0086] Step 6: Perform synonymous entity aggregation on candidate entities according to the entity-set classifier to obtain a list of synonymous entity sets.
[0087] Based on the context-related entity-set classifier in step 5, the probability that the candidate entity t is in a synonymous relationship with the entities in the entity set S is calculated, and the synonymous entities are aggregated based on the probability of the synonymous relationship to obtain a list of synonymous entity sets.
[0088] First, we create a set P1 through the first candidate entity and use the set P1 to initialize the synonym entity pool Pool. We traverse the other candidate entities in the candidate entity library and for any candidate entity w i , initialize the maximum probability value best_prob and the best index best_index, traverse all synonymous entity sets in the synonymous entity set pool Pool, and for any synonymous entity set P j , calling the entity-set classifier Get the candidate entity w i and the synonymous entity set P j The probability that the entities in the synonymous relationship are synonymous is used to update the maximum probability value best_prob and the best index best_index. After traversing all synonymous entity sets in the synonymous entity set pool Pool, check whether the maximum probability value best_prob exceeds the preset probability threshold θ. If best_prob ≥ θ, the candidate entity w i Add to the synonym entity set P corresponding to the maximum probability value best_index Otherwise, use the candidate entity w i Create a new synonymous entity set and add it to the synonymous entity set pool Pool. After traversing all candidate entities, the synonymous entity aggregation is completed and the synonymous entity set list EntitySetList is obtained.
[0089] Step 7: Create a normalized mapping based on the list of synonymous entity sets.
[0090] Traverse the synonymous entity set list EntitySetList and select the synonymous entity set EntitySetList i The entity with the highest frequency in is taken as the normalized entity w unify , establish a mapping between entities and normalized entities, unify(x) = y, where y represents the entity that appears most frequently in a synonymous entity set, x represents all entities in the synonymous entity set, and unify is a mapping function.
[0091] Step 8: Normalize the original behavior sequence list according to the normalization mapping to obtain a normalized behavior sequence list.
[0092] Initialize the behavior entity sequence set BehaviorList. Traverse the original behavior sequence list OriginalList. For any original behavior sequence u, initialize the temporary behavior sequence temp and traverse the entity w in the original behavior sequence u. For any entity w, obtain the normalized behavior node v through the mapping function unify , then normalize the behavior node v unify Add to the temporary behavior sequence temp. After processing the current original behavior sequence u, add the temporary behavior sequence temp to the entity sequence set BehaviorList. Finally, output the entity sequence set BehaviorList as a normalized behavior sequence list.
[0093] To this end, the following three clustering evaluation indicators are usually used to evaluate the aggregation results of similar behaviors, which are specifically introduced as follows:
[0094] 1) NMI: NMI is used to calculate the normalized mutual information value between sets. NMI consists of information entropy (IE) and mutual information (MI). The definition of NMI is as follows:
[0095]
[0096] Among them, H(X) is the information entropy of X; H(Y) is the information entropy of Y; I(X, Y) is the mutual information between X and Y.
[0097] 2) ARI: ARI is used to calculate the similarity between two assigned clusters. Given the aggregate set C of the model output p and the standard aggregate set C g , ARI is defined as follows:
[0098]
[0099] Where TP is the aggregation set C p and the standard aggregate set C g The number of pairs of elements that appear in the same set; TN is the aggregate set C p and the standard aggregate set C g The number of pairs of elements that appear in different sets in C; N represents the standard aggregation set C g The total number of pairs of elements in ; RI is the Rand Index, E(RI) is the random Rand Index, and max(RI) is the maximum possible value of the Rand Index.
[0100] 3) FMI: FMI uses precision and recall to calculate the similarity between two distribution clusters. The definition of FMI is as follows:
[0101]
[0102] Among them, FP means in the standard aggregation set C g appear in the same cluster, but in the aggregate set C p FN represents the number of pairs of elements that do not appear in the same cluster. p appear in the same cluster, but in the standard aggregation set C g The number of pairs of elements in that do not appear in the same cluster.
[0103] The parameter settings related to the entity-set classifier and the synonymous entity aggregation algorithm are shown in Table 2.
[0104] Table 2 Parameters related to entity-set classifier and synonymous entity aggregation algorithm
[0105] Hyperparameters Numeric Hidden layer latitude 50 Batch 32 Probability threshold θ 0.5 Optimizer Adam Learning Rate 0.0001 Context length 20 Number of contexts 5
[0106] Step 9: Predict group behavior based on the normalized behavior sequence list.
[0107] Specifically, taking the commodity classification behavior as an example, for the candidate entity set A "memory stick, solid state, chocolate, chocolate, chocolate, chocolate, commodity A, commodity B, computer memory..." and the original consumer behavior sequence S "mobile phone, chocolate, computer, chocolate, tablet computer, mobile phone". The group behavior prediction method based on semantic aggregation of the present invention obtains the normalized mapping of commodities according to the entity set A, and normalizes the original consumer behavior sequence S to "mobile phone, chocolate, computer, chocolate, computer, mobile phone". According to the normalized behavior sequence, it can be predicted that the consumer group prefers electronic products, so the subsequent behavior of the consumer group "smart watches", "headphones", etc. can be predicted.
[0108] In order to verify the effectiveness and superiority of the group behavior prediction method model based on semantic aggregation of the present invention, the following comparison model is set to conduct comparative experiments on the widely used benchmark datasets Wiki and NYT:
[0109] 1) K-Means: An unsupervised clustering algorithm that performs clustering based on entity pre-trained embeddings. In the experiment, the K value of K-Means is set to the actual number of sets in the label.
[0110] 2) Louvain: An unsupervised community discovery algorithm. The basic idea is to aggregate nodes in the network layer by layer until a certain stopping condition is reached. In the experiment, cosine similarity is used to measure the similarity between nodes, and the threshold is adjusted in the training set.
[0111] 3) SetExpan+Louvain: Combines the SetExpan and Louvain algorithms. First, SetExpan is used to find the K nearest neighbors of each node, and then the Louvain algorithm is used for community discovery.
[0112] 4) SynSetMine: A neural network algorithm that uses entity-set classifiers to determine the relationship between entities and sets.
[0113] 5) SynSetGe: A method that uses graph neural networks to fuse the co-occurrence frequency and similarity information between entities to construct an entity-set classifier.
[0114] 6) SynBert: A method that uses Bert to encode entities and simultaneously uses character similarity to mine synonymous entity sets.
[0115] Table 3 Performance of different models on the NYT and Wiki datasets
[0116]
[0117] As shown in Table 3, the K-means algorithm performs the worst on both datasets because it only uses the original embedding information of the target entity for clustering and ignores the association information between the target entities and the association information in the contextual semantics. In addition, the unsupervised method cannot utilize label information, which limits the performance of the algorithm. In contrast, the SetExpan+Louvain algorithm uses the K nearest neighbor information of the entity and combines it with the Louvain algorithm, which has been significantly improved compared with the unsupervised algorithm, but it still has a large gap with the SynSetMine model. SynSetMine uses a classifier to determine the degree of match between the candidate entity and the set, and generates a synonymous entity set based on the classifier. This model has better performance than previous methods, but this model only considers the relevance between the entity and the set at the entity level, ignoring the contextual information, which limits the performance of the model to a certain extent. The SynBert model achieved the second best results in both datasets, which shows the effectiveness of Bert for entity representation. SynSetGe+AIEC has a certain improvement over SynSetMine. This model constructs the ET-ALN set through the co-occurrence information between entities and fully mines the relationship between entities through graph neural networks. However, this model ignores the association between contextual information, which makes it perform worse than the present invention. The present invention measures the relevance between candidate entities and entities in the entity set from two aspects: entity relevance and entity context semantic relevance. It performs best among all models, proving the superiority of the group behavior prediction method based on semantic aggregation of the present invention.
[0118] In summary, the group behavior prediction method based on semantic aggregation provided by the present invention focuses on the scenario of behavior sequences with the same semantics but different expressions, and aims at the shortcomings of the prior art in the aggregation of synonymous entities. An entity-set classifier is constructed through context information and entity information, and the relationship between entities and sets is determined. The synonymous entity aggregation is completed using the entity-set classifier. In the behavior sequence construction algorithm, according to the results of synonymous entity aggregation, behaviors with the same semantics in the behavior sequence are mapped to a unified behavior node to achieve aggregation of similar behaviors, reduce interference information caused by the semantic diversity of behaviors in the behavior sequence, and lay the foundation for subsequent behavior sequence prediction tasks. Specifically, the present invention obtains a behavior set from the original behavior sequence, obtains relevant texts on the Internet through a crawler program, and after steps such as word segmentation and removal of stop words, uses Skip Gram to obtain a pre-trained embedding vector, and simultaneously obtains the context information of each behavior. Through an entity-set classifier based on context association, entities with the same meaning are aggregated, and all synonymous entities are mapped to obtain a list of behavior sequence sets. Then, the entity set is normalized based on the behavior sequence set list to obtain a normalized behavior sequence set list, and group behavior is predicted based on the normalized behavior sequence set list, thereby effectively improving the accuracy and efficiency of group behavior prediction.
[0119] In addition, the present invention also provides a computer program product, including a computer program, which implements the steps of the group behavior prediction method based on semantic aggregation when executed by a processor.
[0120] Furthermore, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a group behavior prediction method based on semantic aggregation.
[0121] Furthermore, the present invention also provides a computer device, including a processor, a memory, an input / output interface (I / O for short), a communication interface, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the group behavior prediction method based on semantic aggregation.
[0122] Wherein, the processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Wherein, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the group behavior prediction method based on semantic aggregation is implemented.
[0123] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0124] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for predicting group behavior based on semantic aggregation, characterized in that: include: Obtain the context information of each entity in the entity set and calculate the context representation of each entity; The entity set includes multiple group behavior information; Perform a linear transformation on the context representation of each entity to obtain a context representation set and calculate the context score of the context representation set; The Skip Gram method is used to obtain the entity representation of each entity in the entity set; Perform a linear transformation on the entity representation of each entity to obtain an entity representation set and calculate the entity score of the entity representation set; The final quality score of the entity set is calculated based on the context score and the entity score, and the synonymous entity probability between the candidate entity and the entity in the entity set is calculated to obtain the entity-set classifier; Perform synonymous entity aggregation on candidate entities according to the entity-set classifier to obtain a list of synonymous entity sets; Establish a normalized mapping based on a list of synonymous entity sets; Normalizing the original behavior sequence list according to the normalization mapping to obtain a normalized behavior sequence list; the original behavior sequence list includes a plurality of original group behaviors; Predict group behavior based on a list of normalized behavior sequences.
2. The method for predicting group behavior based on semantic aggregation according to claim 1, characterized in that: The acquiring of context information of each entity in the entity set and calculating the context representation of each entity specifically includes: Randomly obtain k context sequences of each entity w in the entity set S to form context information p; Based on the entity and the context information of the entity, two different LSTM networks are used, respectively through the formula and Perform forward propagation and back propagation to obtain the above representation of the entity And the following characterization in, is the forward propagation function of the LSTM network; is the LSTM network back propagation function; is the vector corresponding to the entity at the tth time step; is the vector of the hidden state at the t-1th time step; is the vector of the hidden state at the t+1th time step; Entity-based context representation And the following characterization Using formula Compute the contextual representation of the entity h p .
3. The method for predicting group behavior based on semantic aggregation according to claim 2, characterized in that: The linear transformation of the context representation of each entity is performed to obtain a context representation set and the context score of the context representation set is calculated, specifically including: Using the formula h' p =Relu(W2Relu(W1h p )) The context representation h for each entity p Perform a linear transformation to obtain the context representation h' after linear transformation p ; Among them, Relu is the activation function; W1 and W2 are linear transformation matrices; The linearly transformed context representation h' of all entities in the entity set p Accumulate and get the context representation set Context-based representation collection Using formula Compute context representation set Context Score context ; Among them, W3, W4, and W5 are linear transformation matrices.
4. The method for predicting group behavior based on semantic aggregation according to claim 3 is characterized in that: The step of performing a linear transformation on the entity representation of each entity to obtain an entity representation set and calculating the entity score of the entity representation set specifically includes: Using the formula h' entity =Relu(W7Relu(W6h entity )) For each entity, the entity representation h entity Perform a linear transformation to obtain the entity representation h' after the linear transformation entity ;W6 and W7 are linear transformation matrices; The entity representation h' after the linear transformation of all entities in the entity set entity Accumulate and get the entity representation set Entity Representation Collection Using formula Computing entity representation sets Entity score Score entity ; Among them, W8, W9, W 10 is the linear transformation matrix.
5. The method for predicting group behavior based on semantic aggregation according to claim 4, characterized in that: The method calculates the final quality score of the entity set based on the context score and the entity score, and calculates the synonymous entity probability between the candidate entity and the entity in the entity set to obtain the entity-set classifier, specifically including: Score based on context context and entity score Score entity , using the formula Score = Score context +Score entity Calculate the final quality score Score of the entity set; Based on the final quality score Score, the formula is used Calculate the synonymous entity probability between the candidate entity t and the entities in the entity set S Get entity-set classifier Among them, σ is the sigmoid function; ScoreS temp is the temporary set S formed after adding the candidate entity t to the entity set S temp The final quality score of S is the final quality score of the entity set S.
6. The method for predicting group behavior based on semantic aggregation according to claim 5, characterized in that: The step of establishing a normalized mapping according to the synonymous entity set list specifically includes: Traverse the list of synonymous entity sets, select the entity with the highest frequency in the synonymous entity set as the normalized entity, and establish a normalized mapping.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for predicting group behavior based on semantic aggregation described in any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for predicting group behavior based on semantic aggregation described in any one of claims 1 to 6 is implemented.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the group behavior prediction method based on semantic aggregation as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Bi-LSTM-based legal named entity identification method
CN115688786A
Small sample automobile supply chain knowledge graph completion method based on adaptive context matching network
CN116681135A
Self-supervised group behavior identification method based on long-short term relation predictive coding and identification system thereof
CN117095460A
Multi-mark classification method and system based on graph attention mechanism
CN117893839A
Method and system for conducting an opinion search engine and a display thereof
US20160162582A1
Cited By
Translation difficulty assessment method and device for text translation model
CN121118922A
