Social network user feature mining and matching method and system based on multi-source semantic fusion
By constructing an undirected and powerless graph and semantic acceptance model, combining the autoencoder and KD-Tree, the problem of insufficient semantic information extraction in user-generated text is solved, and efficient matching and accurate analysis of cross-platform user characteristics is achieved.
Patent Information
- Application Number
- CN202510072256.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-01-17
AI Technical Summary
The prior art is difficult to dig deep into semantic information in user-generated text processing, resulting in insufficient feature extraction, affecting the accuracy and efficiency of user alignment analysis, and easily introducing noisy data.
By constructing an undirected and powerless graph, extracting a collection of fragment text vectors, constructing a semantic acceptance relationship model, splicing the prompt word vector, using the autoencoder dimensionality reduction processing, combining Euclidean distance and KD-Tree for user matching.
It realizes accurate extraction and matching of cross-platform user features, reduces manual tagging costs, improves the accuracy and efficiency of user alignment analysis, and reduces noise interference.
Smart Images

Figure CN119474833B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and system for mining and matching user features of social networks based on multi-source semantic fusion. Background Art
[0002] In today's digital age, social media platforms are growing explosively, and users are increasingly active across multiple platforms, which has led to the continuous expansion of the digital ecosystem and its dynamic evolution. Under this situation, the importance of cross-platform data analysis has become increasingly prominent, and its complexity has also risen sharply. User alignment, also known as user identity link or anchor link prediction, has become one of the core tasks in the field of online social network analysis. Its core goal is to accurately identify and match users belonging to the same entity on different social platforms. With the help of user alignment technology, a comprehensive user view across platforms can be constructed, which is of great significance to the optimization and upgrading of social interest recommendation systems, the accurate tracking of user behavior, and the in-depth development of sentiment analysis.
[0003] At present, existing technologies mainly focus on independent analysis of individual profile attributes (such as user nicknames, geographic locations, occupations, etc.), user-generated article content, and network structures (such as the relationship between followers and followers, friend relationship networks, etc.). With the gradual deepening of research, existing technologies have shown a development trend of integrating multi-dimensional information, and to a certain extent have promoted the evolution of user alignment technology. However, in the process of processing user-generated texts, there is a problem of insufficient feature extraction; in particular, the existing feature extraction methods are difficult to deeply mine the semantic information in the text, and cannot fully and accurately capture the characteristics of the user in the text, resulting in the extracted features often having large deviations and omissions. Since the effectiveness of the overall feature extraction is greatly reduced, the efficiency of subsequent analysis and processing is reduced, and it is also very easy to introduce a large amount of noise data, which seriously interferes with the accuracy and reliability of the user alignment analysis results. Summary of the invention
[0004] In order to accurately and efficiently mine user features in different social network scenarios and improve the accuracy of social network user alignment tasks, the present invention provides a social network user feature mining and matching method and system based on multi-source semantic fusion. The technical solutions adopted are as follows:
[0005] The technical solution of the first aspect of the present invention provides a social network user feature mining and matching method based on multi-source semantic fusion, the method comprising:
[0006] Construct an undirected and unweighted graph based on the user's original data;
[0007] Extract target text data and preprocess the target text data to extract a set of segment text vectors;
[0008] Construct the prompt word vector and concatenate it with the fragment text vector to extract the user feature matrix;
[0009] Based on the user feature matrices of different social networks, user pair matching results are extracted according to the Euclidean distance.
[0010] Furthermore, the undirected unweighted graph has users as nodes and relationships between users as edges, and the undirected weighted graph includes a user set, a user relationship set, and a user attribute set extracted from the user original data.
[0011] Further, extracting target text data and preprocessing the target text data, extracting a segment text vector set includes:
[0012] Perform data cleaning on the target text data and extract the user text data set;
[0013] Segment the user text data set based on the preset separation boundary to extract the segment text data set;
[0014] Construct a semantic connection relationship model, extract the semantic connection relationship between the fragment text data and merge the fragment text data.
[0015] Furthermore, constructing a semantic continuation relationship model, extracting the semantic continuation relationship between the fragment text data and merging the fragment text data includes:
[0016] Calculate the semantic similarity between the fragment text data and the adjacent fragment text data based on the pre-trained BERT model;
[0017] Merge the fragment text data according to the semantic similarity and update the fragment text data set;
[0018] The updated fragment text dataset is vectorized to extract a fragment text vector set.
[0019] Furthermore, the prompt word vector is constructed and concatenated with the segment text vector to extract the user feature matrix including:
[0020] Construct prompt words according to the target feature dimension and convert the prompt words into vector form;
[0021] The prompt word vector and the fragment text vector are concatenated and input into the semantic big model to extract the user feature set;
[0022] Decomposing the user features in the user feature set into a sequence dictionary and converting the user attribute set in the undirected unweighted graph into a tag frequency matrix;
[0023] The autoencoder is used to reduce the dimension of the tag frequency matrix to obtain the user feature matrix.
[0024] Further, decomposing the user features in the user feature set into a sequence dictionary and converting the user attribute set in the undirected unweighted graph into a tag frequency matrix includes:
[0025] Decomposing the user features in the user feature set into a number of uniquely labeled sequence dictionaries;
[0026] Each user attribute instance in the user attribute set in the undirected unweighted graph is decomposed into a tag sequence, and the user attribute set is converted into a tag frequency matrix according to the frequency of each tag sequence.
[0027] Furthermore, the autoencoder is used to reduce the dimension of the tag frequency matrix, and the user feature matrix is obtained, including:
[0028] The token frequency matrix is input into the encoder, and the hidden matrix is calculated using the first mapping function;
[0029] Input the hidden matrix into the decoder, and reconstruct the hidden matrix using a second mapping function;
[0030] The objective function is used to minimize the error between the tag frequency matrix and the reconstructed latent matrix to extract the semantic attribute feature matrix.
[0031] Furthermore, the expression of the objective function is:
[0032]
[0033] In the formula, represents the marker frequency matrix; represents the reconstructed hidden matrix; Indicates the number of user attribute instances; Indicates the number of columns of the marker frequency matrix; represents the reconstructed hidden matrix Line Elements of a column; The first Line Elements of a column.
[0034] Furthermore, based on the user feature matrix of different social networks, the user pair matching results are extracted according to the Euclidean distance, including:
[0035] Based on the user feature matrix of the first social network, a K-dimensional tree is constructed with Euclidean distance as the metric function;
[0036] The user feature vector of the second social network is extracted as the target vector, which is input into the K-dimensional tree and the related vector matching the target vector is extracted by using the search algorithm to extract the user pair matching results.
[0037] The technical solution of the second aspect of the present invention provides a social network user feature mining and matching system based on multi-source semantic fusion, which adopts the social network user feature mining and matching method based on multi-source semantic fusion described in the technical solution of the first aspect of the present invention, and the system includes:
[0038] A graph structure module, configured to construct an undirected and unweighted graph based on the user's original data;
[0039] A data processing module, configured to extract target text data and pre-process the target text data to extract a set of segment text vectors;
[0040] A feature extraction module, configured to construct a prompt word vector and concatenate it with the segment text vector to extract a user feature matrix;
[0041] The user pair matching module is configured to extract user pair matching results based on the user feature matrix of different social networks according to the Euclidean distance.
[0042] The present invention has the following beneficial effects:
[0043] The social network user feature mining and matching method based on multi-source semantic fusion provided by the present invention is used to extract user features in articles generated by users in social networks; by constructing an undirected and unweighted graph, the social network structure and user relationships and attributes are intuitively presented; by preprocessing the target text data and obtaining a set of fragment text vectors, the noise in the text can be effectively removed and the data quality can be improved; by constructing a prompt word vector and splicing the fragment text vector to extract the user feature matrix, by means of a semantic big model to fuse multi-source information, fully mine the text semantics, and accurately extract user features with multi-dimensional semantics; finally, based on the user feature matrices of different social networks, the Euclidean distance is used to match user pairs, thereby realizing cross-network user feature mining and matching, and the whole process of user feature extraction is unsupervised, which not only reduces the cost of manually labeling data, but also surpasses the traditional supervised and semi-supervised methods in terms of accuracy and efficiency, and is helpful to more comprehensively and deeply understand the behavior of users in different social networks and realize collaborative services among multiple platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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.
[0045] Figure 1A method flow chart of a social network user feature mining and matching method based on multi-source semantic fusion provided by an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of the structure of a social network user feature mining and matching system based on multi-source semantic fusion provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a social network user feature mining and matching method and system based on multi-source semantic fusion proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0049] The following is a detailed description of a method and system for mining and matching user features in a social network based on multi-source semantic fusion provided by the present invention in conjunction with the accompanying drawings.
[0050] See also Figure 1 , which shows a method flow chart of a social network user feature mining and matching method based on multi-source semantic fusion provided by an embodiment of the present invention, the method comprising:
[0051] Step S100: construct an undirected unweighted graph based on the original user data; specifically, obtain the original user data from the database or public interface of each social network platform. During the data collection process, the original user data needs to be cleaned and pre-processed in a unified format; then the users in the social network are represented as nodes, and the relationships between users (friendship, fan relationship, follow-up relationship) are represented as edges, and an undirected unweighted graph G=(U,E,P) is constructed; where U represents the user set, a unique identifier (such as user ID) is assigned to the user, and these users are aggregated to form the user set U; E represents the relationship between users Set, that is, for each relationship, if user 1 has a certain social relationship with user 2, an undirected edge connecting node 1 and node 2 is created in the graph. For example, if user 1 follows user 2, an edge from node 1 to node 2 is added to the graph. At the same time, since it is an undirected graph, an edge from 2 to 1 is also added. This process is repeated until all social relationships are processed to form a user relationship set E; A represents a user attribute set, including nickname, occupation, industry, geographic location, and user-generated article content. These attribute information are associated with the corresponding user nodes and stored to form a user attribute set A. Step S100 can intuitively organize and present the user data structure in the social network by constructing an undirected unweighted graph, which helps to quickly locate and obtain the user's social relationship network information, and can conveniently perform various social network analysis operations based on the graph structure, providing a basis for comprehensively considering the user's social background and own attributes when further mining user characteristics.
[0052] Step S200: extracting target text data and preprocessing the target text data to extract a segment text vector set;
[0053] Step S200 specifically includes:
[0054] Step S210: Clean the target text data and extract the user text dataset; specifically, the target text data is article data crawled from a social network; first, remove the noise data in the target text data, identify and delete the invalid content in the target text data, such as advertisements, duplicate content, and non-text information (such as picture, video links, etc.); the advertisement text can be identified by regular expression matching or text classification methods based on machine learning; at the same time, for the processing of duplicate content, the text similarity calculation method can be used to keep only one copy of the duplicate articles and delete the rest of the duplicate copies; then perform word segmentation on the target text data after data cleaning and standardize the vocabulary, including but not limited to uniformly processing different forms of words (simplified, traditional, case-sensitive, synonyms, etc.) to ensure the consistency of the text data; finally, remove the stop words such as "de", "shi", "zai" in the target text data, delete or standardize the special characters and symbols in the text, such as HTML symbols, punctuation marks, line breaks, emojis, etc., to ensure the integrity of the text structure. Through the above data cleaning operations, the quality of the target text data can be significantly improved, a large amount of irrelevant information that interferes with subsequent feature extraction and semantic analysis can be removed, ensuring that the data for subsequent processing are all valuable text content, avoiding the misleading of the analysis results by invalid data, providing a data basis for more accurately mining user features and performing matching work, and helping to improve the effectiveness and reliability of the entire social network user feature mining and matching method based on multi-source semantic fusion;
[0055] Step S220: Segment the user text data set based on preset separation boundaries and extract the fragment text data set; specifically, the preset separation boundaries are the typesetting structure or punctuation marks of the article, and the user articles in the user text data set are divided into fragments to obtain the fragment text data set D; the segmentation based on the article typesetting structure is specifically to divide the text content according to the different format features displayed in the article in the presentation form; for example, by identifying elements such as titles and subtitles, and using their locations as boundaries, the article is divided into semantic sections of different levels; at the same time, the blank lines between paragraphs, which are obvious typesetting marks, can be used to divide the article into relatively independent parts according to paragraphs, so that the text is disassembled into multiple more independent and related fragments according to its original layout structure, which conforms to the semantic logic of the article and provides a reasonable basic unit for subsequent text analysis and feature extraction operations; segmentation based on punctuation marks mainly splits the article content according to the semantic separation role played by punctuation marks in sentences. For example, punctuation marks such as period, question mark, and exclamation mark, which usually indicate the end of a sentence, become key nodes for segmentation, and can cut the article into relatively independent sentence fragments; semicolons can also play a role in long sentences, further subdividing long sentences into more semantically compact clauses; in addition, for special punctuation marks and combined punctuation marks such as ellipsis, quotation marks, brackets, dashes, etc., it is necessary to flexibly judge whether to use them as segmentation boundaries based on their impact on semantic expression in specific contexts, so as to refine the article into small fragments that are easy to analyze and have relatively clear semantics, which is conducive to the subsequent mining of semantic information in the text;
[0056] This implementation can break down long, complex articles into relatively independent semantic fragments that are easier to manage and analyze by segmenting the user text dataset according to preset separation boundaries. This segmentation method follows the natural layout and semantic expression rules of the article itself, which helps to more accurately mine the semantic information in the text later. Whether it is using the semantic continuation relationship model to merge fragments, or further vectorizing and extracting features through a large semantic model, these operations can be carried out more efficiently based on these more detailed and semantically clear fragments, and user features can be extracted comprehensively and accurately.
[0057] Step S230: constructing a semantic connection relationship model, extracting the semantic connection relationship between the fragment text data and merging the fragment text data;
[0058] Step S230 specifically includes:
[0059] Step S231: Calculate the semantic similarity between the fragment text data and the adjacent fragment text data based on the pre-trained BERT model; specifically, extract a batch of text data with semantic continuation relationship annotations as a training set in advance, take the fragment text pairs as input, and the corresponding semantic continuation relationship as the output label, and use the training set to train the BERT model so that the model can learn the ability to judge the semantic continuation relationship between the fragment texts, and complete the construction of the semantic continuation relationship model; traverse the fragment text data set, for the document fragment Calculate using the pre-trained BERT model and adjacent fragment text The semantic similarity between Indicates A piece of text data;
[0060] Step S232: merge the text segment data according to the semantic similarity and update the text segment data set; specifically, set a suitable semantic similarity threshold, and if the calculated semantic similarity value is greater than or equal to the threshold, determine and If there is a semantic connection between them, then it is determined that there is no semantic connection between them. If it is determined that the document fragment and After the semantic connection is established and marked, they are merged into new segments. The merging method can be to simply splice the contents of the two fragments together, but it is necessary to remove the repeated or redundant parts to ensure that the merged fragment is semantically coherent, natural, and in line with language expression habits; use the merged Replace the original , and in the fragment text dataset Delete , so as to complete the update of the data set by a merge operation. Then continue to follow the above steps, take a group of adjacent fragments from the updated data set to perform the same semantic similarity calculation, judgment and merge operation, and repeat this process until the entire fragment text data set is traversed, so that all adjacent fragments with semantic inheritance relationships are merged; this embodiment can effectively integrate the text content that is semantically inherited and related by constructing a semantic inheritance relationship model and merging the fragment text data, so that the originally scattered fragment text forms a larger text unit that is more coherent and logical; on the one hand, it helps to reduce the complexity of subsequent text processing and improve processing efficiency; on the other hand, it makes the text data better reflect the complete meaning that the user wants to express, and more accurately mines the deep-level features reflected by the user through the text. The merged text is more in line with the actual needs of semantic analysis, can enhance the accuracy of subsequent vectorization and the use of semantic large models to extract user features, and provide more accurate and semantically rich text input for the entire social network user feature mining and matching method based on multi-source semantic fusion, and further improve the reliability of the final user matching results.
[0061] Step S233: vectorize the updated text segment data set; vectorize the merged text segment data set Slice the document according to its maximum length and perform vectorization to form a document vector set ; Among them, the maximum length slice can be selected according to the actual application scenario. An appropriate maximum length value can be set according to the model's input vector length limit or the balance between computational efficiency and text semantic integrity; for the merged fragment text dataset For each text segment in the text segment, check its length. If the length of the text segment is less than or equal to the maximum length, it can be directly retained as a slice unit; if the length of the text segment exceeds the maximum length, the content of the maximum length can be selected from the beginning of the text as a slice, and then the preset window length can be slid back to continue selecting the next slice until the entire long text segment is divided into multiple sub-segments that meet the maximum length requirement; for each segmented text segment, convert the word units contained in it into corresponding vector representations according to the selected vectorization method; taking Word2Vec as an example, for each word in the text segment, find its corresponding pre-trained vector in the Word2Vec model, and then combine these word vectors into a vector that can represent the text segment by averaging, weighted summing, etc.; after such processing, each text segment can be converted into a vector, and all these vectors constitute the document vector set ;
[0062] This embodiment can quantify the semantic information of the text in the form of vectors by vectorizing the updated text segment data set, which is convenient for subsequent calculations and analysis. Slicing according to the maximum length of the document ensures that the length of the text input during the vectorization process is within a controllable range, which not only avoids the problems of excessive consumption of computing resources and difficulty in model processing caused by too long text, but also retains the key semantic content of the text to the greatest extent.
[0063] Step S300: construct a prompt word vector and concatenate it with the segment text vector to extract a user feature matrix;
[0064] Step S300 specifically includes:
[0065] Step S310: construct prompt words according to the target feature dimension and convert the prompt words into vector form; specifically, construct prompt words based on the user feature dimension to be mined and the specific business needs; for example, if it is expected to extract the user's interest features in tourism, the prompt word can be "please analyze the user's interest in tourist attractions, travel methods and travel experience reflected in this fragment of text"; so as to guide the semantic big model to focus on the corresponding semantic feature mining; then, under the framework of the pre-trained language model, the prompt word can be input into a model such as BERT, and each word in the prompt word can be converted into a corresponding vector representation through its word embedding layer to obtain a vector that can represent the entire prompt word;
[0066] Step S320: concatenate the prompt word vector and the segment text vector and input them into the semantic model to extract the user feature set; for the document vector set Each fragment text vector in , and compare it with the vectorized prompt word vector Splice according to dimension =; the spliced vector Input to the semantic big model Process it and output the corresponding user feature set , using the powerful semantic understanding and generation capabilities of the semantic big model, we can mine the user-related features pointed to by the fragment text and the prompt word, and repeat this operation to traverse the entire document vector set , thereby generating a complete set of user features ;
[0067] Step S330: decomposing the user features in the user feature set into a sequence dictionary and converting the user attribute set in the undirected unweighted graph into a label frequency matrix;
[0068] Step S330 specifically includes:
[0069] Step S331: Decompose the user features in the user feature set into a number of uniquely labeled sequence dictionaries; specifically, for the user feature set Each user feature in , decompose it into A uniquely labeled sequence dictionary ; That is, user features are disassembled from abstract semantic representations into specific tag elements to facilitate subsequent quantification processing;
[0070] Step S332: Decompose each user attribute instance in the user attribute set in the undirected unweighted graph into a tag sequence, and transform the user attribute set into a tag frequency matrix according to the frequency of each tag sequence; specifically, for the user Any given attribute instance of the association , can be decomposed into A sequence of markers, where , , Represents a collection of user attributes;
[0071] By statistical properties The frequency of occurrence of each tag in can be expressed as a dimensional character frequency vector : ,in Representation attributes Medium Mark frequency;
[0072] In this way, the entire user attribute set Convert to a marker frequency matrix , where each row corresponds to the frequency vector of an attribute instance, covering the frequency information of all relevant tags.
[0073] Step S340: Use an autoencoder to reduce the dimension of the tag frequency matrix to obtain a user feature matrix; use an autoencoder to reduce the dimension of the tag frequency matrix Perform dimensionality reduction processing to obtain a low-dimensional dense feature matrix; the autoencoder consists of two parts: the encoder and the decoder;
[0074] Step S340 specifically includes:
[0075] Step S341: Input the mark frequency matrix into the encoder and calculate the hidden matrix using the first mapping function; specifically, the encoder uses the first mapping function ,in , Respectively The first weight matrix of dimension The first bias vector of dimension ; the frequency matrix Convert to hidden matrix ;
[0076] Step S342: Input the hidden matrix into the decoder and reconstruct the hidden matrix using the second mapping function; specifically, the decoder uses the second mapping function , , Respectively The second weight matrix of dimension The second bias vector of dimension ; the hidden matrix Refactored to , the purpose is to make the reconstructed With the original input The difference between them is minimal;
[0077] Step S343: Use the objective function to minimize the error between the label frequency matrix and the reconstructed latent matrix to extract the semantic attribute feature matrix; the expression of the objective function is:
[0078]
[0079] In the formula, represents the marker frequency matrix; represents the reconstructed hidden matrix; Indicates the number of user attribute instances; Indicates the number of columns of the marker frequency matrix; represents the reconstructed hidden matrix Line Elements of a column; The first Line Specifically, the mean squared error loss function is used to optimize the parameters of the autoencoder, that is, to adjust the weight matrix , and the bias vector , , the output of the encoder of the autoencoder after training and optimization is the semantic attribute feature matrix ,The semantic attribute feature matrix represents user attributes in the form of a low-dimensional dense vector, and integrates semantic information, providing a more concise and effective data representation for subsequent operations such as user feature matching;
[0080] This embodiment uses an autoencoder to perform dimensionality reduction processing on the tag frequency matrix to obtain a user feature matrix, which can effectively reduce the dimension of the data and remove redundant information while retaining the key semantic information of user attributes; the low-dimensional dense feature matrix reduces the complexity of subsequent calculations. For example, when calculating the similarity between different user features, the amount of calculation will be greatly reduced, improving the operation efficiency. At the same time, through the learning process of the autoencoder, the feature matrix is more representative at the semantic level, and can better capture the intrinsic connection between user attributes and user features, thereby improving the accuracy and effectiveness of the entire social network user feature mining and matching method based on multi-source semantic fusion in mining user features and performing user matching;
[0081] Step S400: Based on the user feature matrices of different social networks, extract user pair matching results according to the Euclidean distance; specifically, for the user from the first social network Any user in , by comparing users With the second social network The Euclidean distance of all users in the same vector space is used to determine the user The smaller the distance between two matching users, the more likely they are the same person.
[0082] Step S400 specifically includes:
[0083] Step S410: Based on the user feature matrix of the first social network, a K-dimensional tree with Euclidean distance as the metric function is constructed; specifically, firstly obtain the first social network , the second social network The user feature vector matrix in , , each row in the matrix represents a user's feature vector, and the dimension of the vector reflects the user's feature representation in different semantic dimensions; KD-Tree is a data structure used for efficient storage and fast search of K-dimensional spatial data;
[0084] Step S420: extract the user feature vector of the second social network as the target vector, input it into the K-dimensional tree and use the search algorithm to extract the relevant vector matching the target vector, and extract the user pair matching results; specifically, for Each feature vector in must be constructed in the K-dimensional tree (based on Construct) to retrieve the vector closest to it, which is equivalent to For each user in Find the most similar (closest) user in the feature vector space corresponding to the network;
[0085] KD-Tree implements an efficient nearest neighbor search algorithm. When a vector is found, it will quickly locate the possible nearest neighbor regions along the branches of the tree by comparing the differences in each dimension, and then calculate the Euclidean distance between the vectors corresponding to the nodes in these regions and the query vector, which can be expressed as:
[0086]
[0087] In the formula, Representation vector and The Euclidean distance between Indicates from social network The The feature vector of each user; From social networks The The feature vector of each user; Represents the dimension of the user feature vector; Represents an index variable; Indicates from social network The The feature vector of the user The value of the dimension; Indicates from social network The The feature vector of the user The value of the dimension;
[0088] Use the above formula to find the vector with the smallest distance; for example, there is a user exist In the network, the corresponding feature vector is ,Will Input into the constructed KD-Tree, the KD-Tree will go through a series of internal calculations and output The eigenvector with the closest Euclidean distance in the network , and this Corresponding user It is currently believed that Network The user who is most likely to be the same natural person; repeat the above search operation to traverse All eigenvectors of Every user in the network is Find the closest users in the network, record these user pairs and the corresponding Euclidean distance values; then set a distance threshold according to actual needs. When the Euclidean distance is less than this threshold, the two users are considered to be a matching user pair, that is, they are considered to be the same natural person with a high probability, thereby realizing the extraction of cross-network user pair matching results.
[0089] In summary, the present invention extracts user pair matching results by combining Euclidean distance with KD-Tree based on user feature matrices of different social networks. With the help of KD-Tree's efficient data structure, it can quickly find the nearest neighbor vector in the high-dimensional vector space, greatly improving the efficiency of the matching calculation and avoiding the huge amount of calculation of the distance between all user feature vectors. The advantages are obvious especially when processing large-scale social network user data. At the same time, using Euclidean distance as a metric function to measure the similarity between users, from the perspective of the semantic feature matrix, it can more accurately capture the similarity of users on different social networks, providing an efficient and relatively accurate solution for cross-network user alignment tasks, which is helpful for subsequent in-depth application and research in many related fields such as social network analysis and user behavior tracking.
[0090] The present invention will be further described below with reference to a specific example. This example is based on a set of real social networks collected from the Internet: Sina Weibo and Zhihu. The detailed information is shown in Table 1:
[0091]
[0092] Table 1 records the statistics of Weibo-Zhihu related data
[0093] S1: Consider the users in the social networks Sina Weibo and Zhihu to be matched as the network Node Collection , the attention between users in a network is regarded as an undirected edge, such as user There is a following or being followed relationship between them, then there is an edge in the edge set E ; Treat user nicknames, addresses, and user-generated articles as a set of attributes in the network ;
[0094] S2: Clean the content of user-generated articles and remove irrelevant symbols such as HTML tags, advertisements, links, etc.
[0095] S3: Split the document into fragments and generate a document fragment set , use the pre-trained model BERT, traverse the document fragment set D, and merge document fragments with similar content;
[0096] S4: The combined results Slice the document according to its maximum length and perform vectorization to form a document vector set ;
[0097] S5: Construct prompt words, vectorize the prompt words, and concatenate them with the vectorized documents in step S4, generate user features through the large language model, and obtain user feature results R; R includes user features extracted from the article, such as person names, geographic location information, book names, work names, and events;
[0098] S6: User feature embedding, embedding the user's feature set R and attributes into a vector, specifically including the following steps:
[0099] S61: User feature embedding, for user features , can be decomposed into a dictionary of sequences containing k unique tags ; For users Any given attribute instance of the association , which can be decomposed into A sequence of tags; by recording attributes The frequency of each mark in can be expressed as a -dimensional character frequency vector, ,in Representation attributes Medium Mark frequency; hence is converted into a marker frequency matrix ;
[0100] S62: Use the autoencoder to convert the label frequency matrix obtained in S61 ; Reduce the dimension to a low-dimensional dense feature matrix. The encoder first uses a mapping function Convert the input matrix X to the hidden matrix Z, where , Represent the weight matrix and bias vector respectively; then use another mapping function (decoder) Will Refactored to Make and The difference between , Represent the weight matrix and bias vector respectively;
[0101] S7: Identify matching user pairs; for Any user in , by comparing users With another network The Euclidean distance of all users in the same vector space is used to determine the user Matching users: The smaller the Euclidean distance, the more likely the two users are the same natural person; the specific matching steps are as follows:
[0102] S71: Use Sina Weibo The user feature vector set in To construct a K-dimensional tree with Euclidean distance as the metric function;
[0103] S72: Using Zhihu The user feature vector set in For each feature vector in , the vector with the closest Euclidean distance is retrieved from the K-dimensional tree, and the corresponding user is most likely the same natural person;
[0104] Through the steps, the embodiment realizes the deep mining and efficient matching of user features between different social networks, Sina Weibo and Zhihu; from the operations of text cleaning and fragment merging in the data preprocessing link, the quality of text data is improved, the interference of irrelevant information is reduced and the text structure is optimized; the large language model is combined with the prompt word vector splicing method to fully mine the rich user feature dimensions; in the feature processing stage, by embedding user features and attributes into vectors and performing dimensionality reduction by autoencoder, data redundancy is reduced and calculation is simplified while fusing multi-source information; finally, K-dimensional tree retrieval based on Euclidean distance is used to determine matching user pairs, which improves the efficiency and accuracy of cross-network matching, and overall provides technical support for application scenarios such as user analysis, behavior research and possible cross-platform service recommendation across social networks, which helps to break the information barriers between different social networks and more deeply understand the performance and association of users on multiple platforms.
[0105] See also Figure 2 The technical solution of the second aspect of the present invention provides a social network user feature mining and matching system based on multi-source semantic fusion, which adopts the social network user feature mining and matching method based on multi-source semantic fusion described in the technical solution of the first aspect of the present invention, and the system includes:
[0106] A graph structure module, configured to construct an undirected and unweighted graph based on the user's original data;
[0107] A data processing module, configured to extract target text data and pre-process the target text data to extract a set of segment text vectors;
[0108] A feature extraction module, configured to construct a prompt word vector and concatenate it with the segment text vector to extract a user feature matrix;
[0109] The user pair matching module is configured to extract user pair matching results based on the user feature matrix of different social networks according to the Euclidean distance.
[0110] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0111] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A social network user feature mining and matching method based on multi-source semantic fusion, characterized in that: The method comprises: Construct an undirected and unweighted graph based on the user's original data; Extract target text data and preprocess the target text data to extract a set of segment text vectors; Construct the prompt word vector and concatenate it with the fragment text vector to extract the user feature matrix, including: Construct prompt words according to the target feature dimension and convert the prompt words into vector form; The prompt word vector and the fragment text vector are concatenated and input into the semantic big model to extract the user feature set; Decompose the user features in the user feature set into a sequence dictionary and transform the user attribute set in the undirected unweighted graph into a label frequency matrix, including: Decomposing the user features in the user feature set into a number of uniquely labeled sequence dictionaries; Decompose each user attribute instance in the user attribute set in the undirected unweighted graph into a tag sequence, and transform the user attribute set into a tag frequency matrix according to the frequency of each tag sequence; The autoencoder is used to reduce the dimension of the tag frequency matrix to obtain the user feature matrix, including: The token frequency matrix is input into the encoder, and the hidden matrix is calculated using the first mapping function; Input the hidden matrix into the decoder, and reconstruct the hidden matrix using a second mapping function; The objective function is used to minimize the error between the tag frequency matrix and the reconstructed latent matrix to extract the semantic attribute feature matrix; Based on the user feature matrices of different social networks, user pair matching results are extracted according to the Euclidean distance.
2. The social network user feature mining and matching method based on multi-source semantic fusion according to claim 1, characterized in that: The undirected unweighted graph has users as nodes and the relationships between users as edges. The undirected weighted graph includes a user set, a user relationship set, and a user attribute set extracted from the user's original data.
3. The social network user feature mining and matching method based on multi-source semantic fusion according to claim 1, characterized in that: Extract the target text data and preprocess the target text data. The extracted segment text vector set includes: Perform data cleaning on the target text data and extract the user text data set; Segment the user text data set based on the preset separation boundary to extract the segment text data set; Construct a semantic connection relationship model, extract the semantic connection relationship between the fragment text data and merge the fragment text data.
4. The social network user feature mining and matching method based on multi-source semantic fusion according to claim 3, characterized in that: Constructing a semantic continuation relationship model, extracting the semantic continuation relationship between the fragment text data and merging the fragment text data includes: Calculate the semantic similarity between the fragment text data and the adjacent fragment text data based on the pre-trained BERT model; Merge the fragment text data according to the semantic similarity and update the fragment text data set; The updated fragment text dataset is vectorized to extract a fragment text vector set.
5. The social network user feature mining and matching method based on multi-source semantic fusion according to claim 1, characterized in that: The expression of the objective function is: In the formula, represents the marker frequency matrix; represents the reconstructed hidden matrix; Indicates the number of user attribute instances; Indicates the number of columns of the marker frequency matrix; represents the reconstructed hidden matrix Line Elements of a column; The first Line Elements of a column.
6. The social network user feature mining and matching method based on multi-source semantic fusion according to claim 1, characterized in that: Based on the user feature matrix of different social networks, the user pair matching results are extracted according to the Euclidean distance, including: Based on the user feature matrix of the first social network, a K-dimensional tree is constructed with Euclidean distance as the metric function; The user feature vector of the second social network is extracted as the target vector, which is input into the K-dimensional tree and the related vector matching the target vector is extracted by using the search algorithm to extract the user pair matching results.
7. A social network user feature mining and matching system based on multi-source semantic fusion, characterized by: The social network user feature mining and matching method based on multi-source semantic fusion according to any one of claims 1 to 6 is adopted, and the system comprises: A graph structure module, configured to construct an undirected and unweighted graph based on the user's original data; A data processing module, configured to extract target text data and pre-process the target text data to extract a set of segment text vectors; A feature extraction module, configured to construct a prompt word vector and concatenate it with the segment text vector to extract a user feature matrix; The user pair matching module is configured to extract user pair matching results based on the user feature matrix of different social networks according to the Euclidean distance.
Citation Information
Patent Citations
Dynamic social network representation learning method
CN114037550A
Text generation method and system based on prompt project and fine tuning technology
CN118095292A