Training method, inference method and electronic device of user attribute inference model

CN115796282BActive Publication Date: 2026-10-30INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211494136.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2026-10-30
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

[0004]本申请提供一种用户属性推断模型的训练方法、推断方法和电子设备,用以解决现有技术中如何对未知用户属性进行推断的问题

Benefits of technology

[0062]本申请提供的用户属性推断模型的训练方法、推断方法和电子设备,通过获取多个用户各自的推文内容样本,以及各用户对应的属性标签;基于多个用户各自的推文内容样本,构建多个用户对应的用户关系图;分别对多个用户各自的推文内容样本进行编码,得到多个用户各自对应的初始编码特征;将多个用户各自对应的初始编码特征和用户关系图输入至初始用户属性推断模型中,得到各用户对应的预测属性;根据各用户对应的预测属性和属性标签,对初始用户属性推断模型进行更新,以得到训练后的用户属性推断模型。这样基于多个用户各自对应的初始编码特征和构建的用户关系图,共同训练用户属性推断模型,不仅充分考虑到了用户自身的推文内容样本的语义信息,而且充分考虑用户与其他用户之间的关系,使得后续基于训练得到的用户属性推断模型进行用户属性推断时,可以准确地推断出用户属性,解决了现有技术中如何对未知用户属性进行推断的问题,且提高了推断结果的准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115796282B_ABST
    Figure CN115796282B_ABST
Patent Text Reader

Abstract

The application provides a training method and an inference method of a user attribute inference model and an electronic device, and relates to the technical field of artificial intelligence and deep learning. The method comprises the following steps: obtaining tweet content samples of a plurality of users respectively, and attribute labels corresponding to the users; constructing user relationship graphs corresponding to the plurality of users based on the tweet content samples of the plurality of users respectively; encoding the tweet content samples of the plurality of users respectively to obtain initial encoding features corresponding to the plurality of users respectively; inputting the initial encoding features corresponding to the plurality of users respectively and the user relationship graphs into an initial user attribute inference model to obtain predicted attributes corresponding to the users; and updating the initial user attribute inference model according to the predicted attributes corresponding to the users and the attribute labels to obtain a trained user attribute inference model, thereby solving the problem of how to infer unknown user attributes in the prior art and improving the accuracy of the inference result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence and deep learning technology, and in particular to a training method, inference method and electronic device for a user attribute inference model. Background Technology

[0002] In recent years, with the rapid development of computer networks, user attributes, such as geographic location, have been widely used in areas such as online law enforcement, demographics, and personalized information recommendations. However, considering information security, many users do not fill in their real attributes online. Therefore, to obtain the user attributes of unknown users, it is necessary to infer their user attributes.

[0003] Therefore, how to infer the attributes of unknown users is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] This application provides a training method, an inference method, and an electronic device for a user attribute inference model, to solve the problem of how to infer unknown user attributes in the prior art.

[0005] Firstly, this application provides a method for training a user attribute inference model, which may include:

[0006] Obtain sample tweets from multiple users, along with their corresponding attribute tags.

[0007] Based on the tweet content samples of the multiple users, a user relationship graph corresponding to the multiple users is constructed.

[0008] Each of the multiple users' tweet content samples is encoded to obtain the initial encoding features corresponding to each of the multiple users.

[0009] The initial encoded features corresponding to each of the multiple users and the user relationship graph are input into the initial user attribute inference model to obtain the predicted attributes corresponding to each user.

[0010] The initial user attribute inference model is updated based on the predicted attributes and attribute labels corresponding to each user to obtain the trained user attribute inference model.

[0011] According to the training method of the user attribute inference model provided in this application, the initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network. The method involves inputting the initial encoded features corresponding to each of the multiple users and the user relationship graph into the initial user attribute inference model to obtain the predicted attributes corresponding to each user, including:

[0012] The following processing is performed on the initial encoded features corresponding to each user:

[0013] The initial coding features are input into the transform network to obtain the transform coding features corresponding to the user.

[0014] The transform coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; wherein, the target coding features include the transform coding features and the coding features corresponding to the associated users, and the associated users are users who have an association relationship with the user in the user relationship graph.

[0015] The target encoded features are fed into the adaptive adjustment network to obtain the predicted attributes corresponding to the user.

[0016] According to the training method of the user attribute inference model provided in this application, the step of inputting the transformed coding features and the user relationship graph into the propagation network to obtain the target coding features corresponding to the user includes:

[0017] The transformed coding features and the user relationship graph are input into the propagation network to obtain the coding features corresponding to the associated users.

[0018] The target coding feature is obtained by concatenating the transformed coding feature and the coding feature corresponding to the associated user.

[0019] According to the training method for a user attribute inference model provided in this application, the step of constructing a user relationship graph corresponding to the multiple users based on the tweet content samples of each of the multiple users includes:

[0020] Based on the tweet content samples of the multiple users, an initial user relationship graph corresponding to the multiple users is constructed.

[0021] The user relationship graph is obtained by removing user nodes that meet preset conditions from the initial user relationship graph; wherein the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users.

[0022] According to the training method for a user attribute inference model provided in this application, obtaining tweet content samples from multiple users includes:

[0023] For each user, obtain the initial tweet content sample corresponding to that user.

[0024] The initial tweet content sample is sequentially denoised and segmented to obtain multiple initial word segments. Stop words are then removed from the multiple initial word segments to obtain multiple target word segments.

[0025] Based on the multiple target word segments, a sample of the tweet content corresponding to the user is generated.

[0026] According to the training method of the user attribute inference model provided in this application, the step of updating the initial user attribute inference model based on the predicted attributes and attribute labels corresponding to each user includes:

[0027] For each user, a cross-entropy loss is constructed based on the predicted attribute and the attribute label corresponding to the user.

[0028] The initial user attribute inference model is updated based on the cross-entropy loss corresponding to each user.

[0029] Secondly, this application also provides a user attribute inference method, which includes:

[0030] Obtain the target tweet content of the user to be inferred.

[0031] The target tweet content is encoded to obtain the initial encoded features corresponding to the user to be inferred.

[0032] The initial encoded features and user relationship graph corresponding to the user to be inferred are input into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any of the first aspects mentioned above.

[0033] According to the user attribute inference method provided in this application, the step of inputting the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred includes:

[0034] The initial encoded features are input into the transform network of the user attribute inference model to obtain the transformed encoded features corresponding to the user to be inferred.

[0035] The transformed coding features and the user relationship graph are input into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated user.

[0036] The target encoded features are fed into the adaptive adjustment network of the user attribute inference model to obtain the predicted attribute corresponding to the user to be inferred.

[0037] According to the user attribute inference method provided in this application, the step of inputting the transformed coding features and the user relationship graph into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred includes:

[0038] The transformed coding features and the user relationship graph are input into the propagation network to obtain the coding features corresponding to the associated users.

[0039] The target coding feature is obtained by concatenating the transformed coding feature and the coding feature corresponding to the associated user.

[0040] Thirdly, this application also provides a training apparatus for a user attribute inference model, which may include:

[0041] The first acquisition unit is used to acquire tweet content samples from multiple users, as well as the corresponding attribute tags for each user.

[0042] The construction unit is used to construct a user relationship graph corresponding to the multiple users based on the tweet content samples of each user.

[0043] The first encoding unit is used to encode the tweet content samples of the multiple users respectively to obtain the initial encoding features corresponding to the multiple users.

[0044] The first processing unit is used to input the initial encoded features corresponding to each of the multiple users and the user relationship graph into the initial user attribute inference model to obtain the predicted attributes corresponding to each user.

[0045] The update unit is used to update the initial user attribute inference model according to the predicted attributes and attribute labels corresponding to each user, so as to obtain the trained user attribute inference model.

[0046] According to the training apparatus for a user attribute inference model provided in this application, the initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network.

[0047] The first processing unit is specifically configured to perform the following processing on the initial encoding features corresponding to each user:

[0048] The initial coding features are input into the transformation network to obtain the transformed coding features corresponding to the user; the transformed coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated users, and the associated users are users who have an association relationship with the user in the user relationship graph; the target coding features are input into the adaptive adjustment network to obtain the predicted attribute corresponding to the user.

[0049] According to the training apparatus for a user attribute inference model provided in this application, the first processing unit is specifically used to input the transformed coding features and the user relationship graph into the propagation network to obtain the coding features corresponding to the associated users; and to perform concatenation processing on the transformed coding features and the coding features corresponding to the associated users to obtain the target coding features.

[0050] According to the training device for a user attribute inference model provided in this application, the construction unit is specifically used to construct an initial user relationship graph corresponding to the multiple users based on the tweet content samples of the multiple users; and to remove user nodes that meet preset conditions from the initial user relationship graph to obtain the user relationship graph; wherein, the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users.

[0051] According to the training device for a user attribute inference model provided in this application, the first acquisition unit is specifically used to acquire an initial tweet content sample corresponding to each user; sequentially perform denoising processing and word segmentation processing on the initial tweet content sample to obtain multiple initial word segments, and remove stop words from the multiple initial word segments to obtain multiple target word segments; and generate a tweet content sample corresponding to the user based on the multiple target word segments.

[0052] According to the training apparatus for a user attribute inference model provided in this application, the update unit is specifically used to construct a cross-entropy loss corresponding to each user based on the predicted attribute and the attribute label corresponding to the user; and to update the initial user attribute inference model based on the cross-entropy loss corresponding to each user.

[0053] Fourthly, this application also provides a user attribute inference device, which may include:

[0054] The second acquisition unit is used to acquire the target tweet content of the user to be inferred.

[0055] The second encoding unit is used to encode the target tweet content to obtain the initial encoding features corresponding to the user to be inferred.

[0056] The second processing unit is used to input the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any of the first aspects mentioned above.

[0057] According to a user attribute inference apparatus provided in this application, the second processing unit is specifically configured to: input the initial coding features into the transformation network of the user attribute inference model to obtain the transformed coding features corresponding to the user to be inferred; input the transformed coding features and the user relationship graph into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated user; and input the target coding features into the adaptive adjustment network of the user attribute inference model to obtain the predicted attribute corresponding to the user to be inferred.

[0058] According to a user attribute inference device provided in this application, the second processing unit is specifically used to input the transform coding feature and the user relationship graph into the propagation network to obtain the coding feature corresponding to the associated user; and to perform concatenation processing on the transform coding feature and the coding feature corresponding to the associated user to obtain the target coding feature.

[0059] Fifthly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a training method for a user attribute inference model as described in any of the first aspects above; or, when executing the program, it implements a user attribute inference method as described in any of the second aspects above.

[0060] Sixthly, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the training method for the user attribute inference model as described in any of the first aspects above, or, when executed, implements the user attribute inference method as described in any of the second aspects above.

[0061] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements a training method for a user attribute inference model as described in any of the first aspects above; or, when executed, implements a user attribute inference method as described in any of the second aspects above.

[0062] The user attribute inference model training method, inference method, and electronic device provided in this application acquire tweet content samples from multiple users, along with corresponding attribute labels for each user; construct a user relationship graph based on these samples; encode each user's tweet content samples to obtain initial encoded features; input these initial encoded features and the user relationship graph into an initial user attribute inference model to obtain predicted attributes for each user; and update the initial user attribute inference model based on the predicted attributes and attribute labels for each user to obtain a trained user attribute inference model. This method, by jointly training the user attribute inference model based on the initial encoded features and constructed user relationship graph for multiple users, not only fully considers the semantic information of each user's own tweet content samples but also the relationships between users. This allows for accurate inference of user attributes when using the trained model, solving the problem of inferring unknown user attributes in existing technologies and improving the accuracy of the inference results. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 A flowchart illustrating a training method for a user attribute inference model provided in an embodiment of this application;

[0065] Figure 2 This is a schematic diagram of the structure of an initial user attribute inference model provided in an embodiment of this application;

[0066] Figure 3 A flowchart illustrating a user attribute inference method provided in an embodiment of this application;

[0067] Figure 4 A schematic diagram of the structure of a training device for a user attribute inference model provided in an embodiment of the present invention;

[0068] Figure 5 This is a schematic diagram of the user attribute inference device provided in an embodiment of the present invention;

[0069] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0071] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0072] The technical solutions provided in this application can be applied to scenarios such as online law enforcement, demographics, and personalized information recommendation. Taking personalized information recommendation as an example, if user attributes can be accurately inferred, personalized information recommendations can be made accurately based on the inferred user attributes. Therefore, how to accurately infer user attributes is crucial.

[0073] In existing technologies, deep adaptive graph convolutional neural network (DCNN) models are mainly used for user attribute inference. However, when performing user attribute inference, existing DCNN models only consider the semantic information of the user's own text content and do not take into account the relationship between the user and other users. Therefore, using DCNN models for user attribute inference will result in low accuracy of the inference results.

[0074] To improve the accuracy of inference results, when performing user attribute inference, we can consider not only the semantic information of the user's own text content, but also the relationship between the user and other users. That is, we can combine the relationship between the user and other users to perform user attribute inference, thereby improving the accuracy of the inference results.

[0075] Based on the above technical concept, this application provides a training method for a user attribute inference model. This method involves obtaining tweet content samples from multiple users, along with corresponding attribute tags for each user; constructing a user relationship graph based on the tweet content samples from multiple users; encoding the tweet content samples from each user to obtain initial encoded features for each user; inputting the initial encoded features and user relationship graph into the initial user attribute inference model to obtain predicted attributes for each user; and updating the initial user attribute inference model based on the predicted attributes and attribute tags for each user to obtain the trained user attribute inference model.

[0076] The above method constructs user relationship graphs corresponding to multiple users and trains a user attribute inference model based on the initial encoded features of each user and the constructed user relationship graphs. This method not only fully considers the semantic information of the user's own tweet content samples, but also fully considers the relationship between the user and other users. This allows the user attributes to be accurately inferred when performing user attribute inference based on the trained user attribute inference model. This solves the problem of how to infer unknown user attributes in the existing technology and improves the accuracy of the inference results.

[0077] The training method for the user attribute inference model provided in this application will be described in detail below through several specific embodiments. It is understood that these specific embodiments can be combined with each other, and for the same or similar concepts or processes, some embodiments may not be described again.

[0078] Example 1

[0079] Figure 1 This is a flowchart illustrating a training method for a user attribute inference model provided in an embodiment of this application. The training method for this user attribute inference model can be executed by software and / or hardware devices. For example, please refer to... Figure 1 As shown, the training method for this user attribute inference model may include:

[0080] S101. Obtain samples of tweets from multiple users, as well as the corresponding attribute tags for each user.

[0081] For example, when obtaining tweet content samples from multiple users, considering that the methods for obtaining tweet content samples from each user are similar, to avoid redundancy, we will take obtaining the tweet content sample from any one of the multiple users as an example to describe how to obtain tweet content samples from multiple users.

[0082] For example, when obtaining a sample of a user's tweet content, you can first obtain the initial tweet content sample corresponding to the user; then, perform denoising and word segmentation on the initial tweet content sample in sequence to obtain multiple initial word segments, and remove stop words from the multiple initial word segments to obtain multiple target word segments; then, based on the multiple target word segments, generate the tweet content sample corresponding to the user, thereby obtaining the tweet content sample corresponding to the user.

[0083] For example, when obtaining a user's initial tweet content sample, the user's historical tweet content can be collected from different social media platforms, and the collected historical tweet content can be divided into training set, validation set and test set to obtain the user's initial tweet content sample.

[0084] For example, assuming we obtain initial tweet content samples from 9475 users, we can divide these samples into a training set, a validation set, and a test set as needed. Specifically, 5685 initial tweet content samples can be used as the training set, 1895 as the validation set, and 1895 as the test set.

[0085] For example, after obtaining the initial tweet content sample from a user, the initial tweet content sample can be further cleaned. This includes filtering the initial tweet content sample according to natural language processing text cleaning rules to remove noise information, such as removing punctuation marks and HTML tags. The filtered tweet content sample is then further segmented to obtain multiple initial segments. Stop words are then removed from the multiple initial segments to obtain multiple target segments. Based on the multiple target segments, the tweet content sample corresponding to the user is generated, thereby obtaining the tweet content sample corresponding to the user.

[0086] Based on the above description, after obtaining samples of tweets from multiple users, the following step S102 can be executed:

[0087] S102. Based on the tweet content samples of multiple users, construct a user relationship graph corresponding to multiple users.

[0088] For example, when constructing a user relationship graph corresponding to multiple users based on the tweet content samples of each user, an initial user relationship graph can be constructed first based on the tweet content samples of each user; then, user nodes that meet preset conditions are removed from the initial user relationship graph to obtain the final user relationship graph; wherein, the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users. The value of the preset threshold can be set according to actual needs; here, this embodiment of the application does not further limit the specific value of the preset threshold.

[0089] For example, when constructing an initial user relationship graph for multiple users based on their respective tweet content samples, users can be regarded as user nodes in the initial user relationship graph. Regular expressions are used to extract users with interactive relationships, such as @ relationships, from each user's tweet content samples as neighbor nodes of that user in the initial user relationship graph, thus forming the initial user relationship graph of the user network with interactive relationships.

[0090] Taking a preset threshold of 5 as an example, after constructing the initial user relationship graph, in order to avoid a large number of noisy nodes, for example, neighbor nodes with a degree of 1 or a degree greater than 5, as well as neighbor nodes in the initial user relationship graph that do not belong to multiple users, i.e., user nodes corresponding to multiple users are directly connected; and add bidirectional edges to user nodes with @ interaction relationships in the tweet content sample, thereby establishing a user relationship graph corresponding to multiple users.

[0091] In addition to constructing a user relationship graph based on the tweet content samples of multiple users, it is also necessary to encode the tweet content samples of multiple users separately to obtain the initial encoding features corresponding to each user, i.e., to execute S103 as described below. It should be noted that in this embodiment, there is no specific order between S102 and S103. This embodiment is only used as an example of executing S102 first and then S103. Alternatively, S103 can be executed first and then S102; or S102 and S103 can be executed simultaneously. The specific settings can be configured according to actual needs.

[0092] It is understood that, in the embodiments of this application, the user relationship graphs constructed for multiple users can fully describe the relationships between users and other users, and the initial encoding features corresponding to users can fully describe the semantic information of the user's own tweet content samples.

[0093] S103. Encode the tweet content samples of multiple users respectively to obtain the initial encoded features corresponding to each user.

[0094] For example, when encoding the tweet content samples of multiple users, the term frequency-inverse document frequency (TF-IDF) algorithm can be used to encode the tweet content samples of each user. The encoded feature values ​​have certain semantic information and can better represent the semantic information of the user's own tweet content samples. Therefore, they can be used as the initial encoded features for the user. The initial encoded features are the features ranked according to the importance of the feature values ​​corresponding to the tweet content samples.

[0095] After obtaining the initial coding features and user relationship graphs corresponding to each user, the initial coding features and user relationship graphs corresponding to each user can be input into the initial user attribute inference model, that is, the following S104 is executed to train the initial user attribute inference model.

[0096] S104. Input the initial encoded features and user relationship graphs corresponding to multiple users into the initial user attribute inference model to obtain the predicted attributes corresponding to each user.

[0097] For example, in the embodiments of this application, see... Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an initial user attribute inference model provided in an embodiment of this application. The initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network. The initial encoded features and user relationship graphs corresponding to multiple users are input into the initial user attribute inference model to obtain the predicted attributes corresponding to each user, including:

[0098] Perform the following processing on the initial encoded features corresponding to each user:

[0099] The initial coding features are input into the transform network to obtain the transformed coding features corresponding to the user; the transformed coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; the target coding features include the transformed coding features and the coding features corresponding to the associated users, and the associated users are the users with a relationship with the user in the user relationship graph; the target coding features are input into the adaptive adjustment network to obtain the predicted attributes corresponding to the user.

[0100] For example, the initial coding features are input into the transform network, which can combine the initial coding features with the following formula (1) to obtain the transform coding features corresponding to the user.

[0101]

[0102] Where X represents the initial encoded features corresponding to the user, and Z represents the transformed encoded features obtained after processing by a multilayer perceptron (MLP). The transformed encoded features are input into a deep adaptive graph convolutional network model to predict the user's corresponding attributes, i.e., predict the unknown attribute information of the user.

[0103] For example, when inputting the transformed coding features and the user relationship graph into the propagation network to obtain the target coding features corresponding to the user, the transformed coding features and the user relationship graph can be input into the propagation network first to obtain the coding features corresponding to the associated user; then the transformed coding features and the coding features corresponding to the associated user are concatenated to obtain the target coding features corresponding to the user.

[0104] For example, by inputting the transformation coding features and user relationship graph into the propagation network, as shown in the following formula (2), the coding features corresponding to the associated users can be obtained.

[0105]

[0106] Where k represents the neighborhood relationship at distance k, and Hl represents the encoded feature Hl corresponding to the associated user, which is the encoded feature captured by the user from the neighborhood relationship at distance l. This represents the adjacency matrix, which indicates the relationship between users and their neighbors. The encoded feature H associated with each user is... l Information can be obtained from the neighboring users at a distance of l, with each user node as the root. As the depth l increases, the number of corresponding neighboring users also increases, so H l It contains more feature information.

[0107] For example, the transformation coding features and the coding features corresponding to the associated users are concatenated, as shown in the following formula (3), which is the target coding feature corresponding to the user.

[0108]

[0109] Stack is a concatenation operation that concatenates the transformed coding features and the coding features corresponding to the associated users to obtain the target coding features H. It can be seen that the target coding features H include not only the user's own transformed coding features Z, but also the coding features corresponding to its associated users.

[0110] When performing the splicing process using the above formula (3), the transform coding features corresponding to the user are aggregated with the coding features of the first-order neighbors, i.e., H1, according to the topological structure of the user relationship graph, to obtain the first-order coding features corresponding to the user. These first-order coding features are an aggregation of the transform coding features and the coding features of the first-order neighbors, H1. When the first-order coding features corresponding to the user are aggregated with the coding features of the second-order neighbors, i.e., H2, according to the topological structure of the user relationship graph, to obtain the second-order coding features corresponding to the user. These second-order coding features are an aggregation of the coding features of the first-order neighbors, H1, and the coding features of the second-order neighbors, H2. And so on, through the k-layer graph convolutional network, the k-order coding features corresponding to the user are obtained. These k-order coding features are the coding features of the (k-1)-order neighbors, H1, H2 ... k-1 The encoding features H of the k-th order neighbors k The aggregation of k-order coding features yields the target coding features corresponding to the user, thus obtaining the target coding features that include the user's own transformed coding features and the coding features associated with the user.

[0111] After obtaining the target encoding features corresponding to the user, the target encoding features can be fed into the adaptive adjustment network. The predicted attributes corresponding to the user can be obtained by combining the following formulas (4)-(6).

[0112] For example, the automatic adjustment network can also first adaptively adjust the target encoded features of the user, adjust the weights between neighbors in each layer, and generate retention scores using the learnable vector parameters s shared by all user nodes. These scores are used to represent the feature information corresponding to different attributes. These retention scores measure how much feature encoded information corresponding to user associations derived from different propagation layers should be retained to generate multiple importance vectors corresponding to users.

[0113]

[0114] Where S represents the importance vector corresponding to multiple users, and σ(·) represents the activation function. For example, the activation function can be the sigmoid activation function, which is a cross-information entropy loss function that can compress feature values ​​to the range of 0-1, making derivative calculation easier. It is a learnable vector parameter.

[0115]

[0116]

[0117] After obtaining S, the dimensions of S can be adjusted using the reshape and squeeze methods; and the softmax function can be used to classify the user's attributes to obtain the probability values ​​of each category attribute corresponding to the user. Based on the probability values ​​of each category attribute corresponding to the user, the predicted attribute corresponding to the user can be determined.

[0118] After obtaining the unknown attribute information of multiple users, the user attribute inference model can be updated based on the error value of the predicted attributes and the true attributes, i.e., the attribute labels, by executing S105 below.

[0119] S105. Update the initial user attribute inference model based on the predicted attributes and attribute labels corresponding to each user to obtain the trained user attribute inference model.

[0120] For example, when updating the initial user attribute inference model based on the predicted attributes and attribute labels corresponding to each user, a cross-entropy loss corresponding to the user can be constructed based on the predicted attributes and attribute labels corresponding to the user. The initial user attribute inference model is then updated based on the cross-entropy loss corresponding to each user until a condition is met, and the user attribute inference model that meets the condition is determined as the trained user attribute inference model. For example, meeting the condition includes the number of iterations reaching a preset number of iterations, and / or the updated user attribute inference model converging. The preset number of iterations can be set according to actual needs; here, this application embodiment does not further limit the value of the preset number of iterations.

[0121] For example, when updating the initial user attribute inference model based on the cross-entropy loss corresponding to each user, the average loss corresponding to multiple users is determined based on the cross-entropy loss corresponding to each user; the initial user attribute inference model is updated based on the average loss corresponding to multiple users, as shown in the following formula (7) for example:

[0122]

[0123] Where error represents the average loss across multiple users, N represents the number of users, and Li represents the cross-entropy loss for the i-th user. i This represents the attribute label, i.e., the actual result. M represents the number of attribute categories, c represents the attribute category, and y represents the attribute label. ic Let y represent the predicted attribute corresponding to the i-th user. If the predicted attribute is correct, then y ic The value of y is 1; otherwise, y ic The value of p is 0. ic Predict the probability of correctly identifying user attributes.

[0124] By combining the average loss error for multiple users, the PyTorch framework's automatic differentiation mechanism can be used to backpropagate and update the model parameters of the initial user attribute inference model, reducing the error value and thus training the initial user attribute inference model.

[0125] As can be seen, in this embodiment, multiple users' tweet content samples and their corresponding attribute tags are obtained; a user relationship graph is constructed based on these samples; the tweet content samples of each user are encoded to obtain initial encoded features; the initial encoded features and user relationship graph are input into an initial user attribute inference model to obtain predicted attributes for each user; and the initial user attribute inference model is updated based on the predicted attributes and attribute tags for each user to obtain a trained user attribute inference model. This method of training the user attribute inference model based on the initial encoded features and constructed user relationship graph of multiple users not only fully considers the semantic information of the user's own tweet content samples but also the relationship between the user and other users. This allows for accurate inference of user attributes when using the trained model, solving the problem of inferring unknown user attributes in existing technologies and improving the accuracy of the inference results.

[0126] To verify the technical solution provided in this application's embodiments, taking geographic location attributes as an example, existing user attribute inference models based on plain text, pure network, and multi-view fusion can be compared and verified with the user attribute inference model provided in this application's embodiments. During the comparison and verification, the effectiveness of the user attribute inference model can be verified using mean error, median error, and accuracy meeting the tolerance error. Mean error represents the average difference between the predicted and actual geographic location attributes for all users; a lower Mean value indicates a better prediction performance of the user attribute inference model. Median error represents the median of the predicted and actual geographic location attributes for all users; a lower Median value indicates a better prediction performance of the user attribute inference model. Accuracy meeting the tolerance error represents the proportion of users whose predicted and actual geographic location attributes fall within the error range. Taking 161 kilometers as an example, ACC@161 represents the proportion of predicted and actual geographic location attributes falling within 161 kilometers; a higher ACC@161 value indicates a better prediction performance of the user attribute inference model.

[0127] Table 1

[0128]

[0129]

[0130] As shown in Table 1 above, it can be seen that user attribute inference models such as HierLR based on pure text only consider the semantic information of the user's own tweet content samples, resulting in insufficient extraction of the target encoding features corresponding to the user. The Mean and Median values ​​are high, while the ACC@161 value is low, leading to poor prediction performance. User attribute inference models such as UDI based on pure networks, compared to pure text-based models, consider the relationship between users and other users, extracting the encoding features corresponding to associated users. Their prediction performance is relatively better than that of pure text-based models. Furthermore, user attribute inference models based on multi-view fusion, compared to the previous two, consider both the semantic information of the user's own tweet content samples and the relationship between users and other users. The extracted target encoding features are the result of combining the user's target encoding features with the encoding features corresponding to associated users, thus extracting more comprehensive target encoding features. Simultaneously, the validation results show that the multi-view fusion-based user attribute inference model has the lowest Mean and Median values ​​and the highest ACC@161 value among the three types of user attribute inference models. The user attribute inference model based on deep adaptive graph convolutional neural network in this application has a Mean value of 490, a Median value of 35, and an ACC@161 value of 63%. Compared with the three types of user attribute inference models, the Mean and Median values ​​are the lowest, and the ACC@161 value is the highest, indicating that the user attribute inference model has the best prediction performance.

[0131] Therefore, the user attribute inference model based on deep adaptive graph convolutional neural network provided in this application can accurately infer user attributes when used for user attribute inference, solving the problem of how to infer unknown user attributes in the prior art and improving the accuracy of the inference results.

[0132] The above embodiment one describes in detail how to train the user attribute inference model in this application embodiment, that is, the training process of the user attribute inference model. Below, the application process of the user attribute inference model will be described in detail through the following embodiment two.

[0133] Example 2

[0134] Figure 3 This is a flowchart illustrating a user attribute inference method provided in an embodiment of this application. This user attribute inference method can be executed by software and / or hardware devices. For an example, please refer to [link to example]. Figure 3 As shown, the user attribute inference method may include:

[0135] S301. Obtain the target tweet content of the user to be inferred.

[0136] For example, when obtaining the target tweet content of the user to be inferred, the target tweet content of the user to be inferred can be received from other devices, or the target tweet content of the user to be inferred can be obtained from a third-party database, or the target tweet content of the user to be inferred can be retrieved from local storage, etc. The specific settings can be configured according to actual needs. Here, this application embodiment does not impose specific limitations.

[0137] After obtaining the target tweet content of the user to be inferred, the target tweet content can be encoded to obtain the initial encoded features corresponding to the user to be inferred, that is, the following S302 is executed:

[0138] S302. Encode the content of the target tweet to obtain the initial encoded features corresponding to the user to be inferred.

[0139] It should be noted that in this embodiment, encoding the target tweet content to obtain the initial encoding features corresponding to the user to be inferred is similar to the method of encoding the user's tweet content sample to obtain the user's initial encoding features in Embodiment 1 above. For details, please refer to the relevant description in Embodiment 1 above. Here, this embodiment will not repeat the description.

[0140] S303. Input the initial coding features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained in the above embodiment one.

[0141] As can be seen, in this embodiment, by acquiring the target tweet content of the user to be inferred and encoding the target tweet content, the initial encoded features corresponding to the user to be inferred are obtained. Then, the initial encoded features corresponding to the user to be inferred and the user relationship graph are input into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. In this way, predicting the predicted attributes corresponding to the user to be inferred through the user attribute inference model not only fully considers the semantic information of the tweet content sample of the user to be inferred, but also fully considers the relationship between the user to be inferred and other users. It can accurately infer the user attributes of the user to be inferred, solve the problem of how to infer unknown user attributes in the prior art, and improve the accuracy of the inference results.

[0142] Optionally, the initial encoded features and user relationship graph corresponding to the user to be inferred are input into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred, including:

[0143] The initial encoded features are input into the transform network of the user attribute inference model to obtain the transformed encoded features corresponding to the user to be inferred.

[0144] The transformed coding features and user relationship graph are input into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated users.

[0145] The target encoded features are fed into the adaptive adjustment network of the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred.

[0146] Optionally, the transformed coding features and user relationship graph are input into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred, including:

[0147] By inputting the transformed coding features and user relationship graph into the propagation network, the coding features corresponding to the associated users are obtained.

[0148] The transformed coding features and the coding features corresponding to the associated users are concatenated to obtain the target coding features.

[0149] The training apparatus and user attribute inference apparatus of the user attribute inference model provided by the present invention will be described below. The training apparatus of the user attribute inference model described below and the training method of the user attribute inference model described above can be referred to in correspondence with each other, and the user attribute inference apparatus and the user attribute inference method described above can be referred to in correspondence with each other.

[0150] Figure 4 This is a schematic diagram of the structure of the training device for the user attribute inference model provided in an embodiment of the present invention. For example, please refer to [link / reference]. Figure 4 As shown, the training device 40 for the user attribute inference model may include:

[0151] The first acquisition unit 401 is used to acquire tweet content samples from multiple users, as well as the attribute tags corresponding to each user.

[0152] Construction unit 402 is used to construct a user relationship graph corresponding to multiple users based on the tweet content samples of multiple users.

[0153] The first encoding unit 403 is used to encode the tweet content samples of multiple users respectively, so as to obtain the initial encoding features corresponding to each user.

[0154] The first processing unit 404 is used to input the initial encoded features and user relationship graphs corresponding to multiple users into the initial user attribute inference model to obtain the predicted attributes corresponding to each user.

[0155] The update unit 405 is used to update the initial user attribute inference model based on the predicted attributes and attribute labels corresponding to each user, so as to obtain the trained user attribute inference model.

[0156] Optionally, the initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network.

[0157] The first processing unit 404 is specifically used to perform the following processing on the initial encoded features corresponding to each user:

[0158] The initial coding features are input into the transform network to obtain the transformed coding features corresponding to the user; the transformed coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; the target coding features include the transformed coding features and the coding features corresponding to the associated users, and the associated users are the users with a relationship with the user in the user relationship graph; the target coding features are input into the adaptive adjustment network to obtain the predicted attributes corresponding to the user.

[0159] Optionally, the first processing unit 404 is specifically used to input the transform coding features and the user relationship graph into the propagation network to obtain the coding features corresponding to the associated users; and to perform concatenation processing on the transform coding features and the coding features corresponding to the associated users to obtain the target coding features.

[0160] Optionally, the construction unit 402 is specifically used to construct an initial user relationship graph corresponding to multiple users based on the tweet content samples of multiple users; remove user nodes that meet preset conditions from the initial user relationship graph to obtain the user relationship graph; wherein, the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users.

[0161] Optionally, the first acquisition unit 401 is specifically used to acquire the initial tweet content sample corresponding to each user; sequentially perform denoising and word segmentation processing on the initial tweet content sample to obtain multiple initial word segments, and remove stop words from the multiple initial word segments to obtain multiple target word segments; and generate the tweet content sample corresponding to the user based on the multiple target word segments.

[0162] Optionally, update unit 405 is specifically used to construct the cross-entropy loss corresponding to each user based on the predicted attributes and attribute labels of the user; and to update the initial user attribute inference model based on the cross-entropy loss corresponding to each user.

[0163] The training device 40 for the user attribute inference model provided in this embodiment of the invention can execute the technical solution of the training method for the user attribute inference model in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the training method for the user attribute inference model. Please refer to the implementation principle and beneficial effects of the training method for the user attribute inference model. It will not be repeated here.

[0164] Figure 5 This is a schematic diagram of the user attribute inference device provided in an embodiment of the present invention. For example, please refer to [link / reference]. Figure 5 As shown, the user attribute inference device 50 may include:

[0165] The second acquisition unit 501 is used to acquire the target tweet content of the user to be inferred.

[0166] The second encoding unit 502 is used to encode the content of the target tweet to obtain the initial encoding features corresponding to the user to be inferred.

[0167] The second processing unit 503 is used to input the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of the associated users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of the above embodiments.

[0168] Optionally, the second processing unit 503 is specifically used to input the initial encoded features into the transform network of the user attribute inference model to obtain the transformed encoded features corresponding to the user to be inferred; input the transformed encoded features and the user relationship graph into the propagation network of the user attribute inference model to obtain the target encoded features corresponding to the user to be inferred; wherein, the target encoded features include the transformed encoded features and the encoded features corresponding to the associated user; and input the target encoded features into the adaptive adjustment network of the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred.

[0169] Optionally, the second processing unit 503 is specifically used to input the transform coding features and the user relationship graph into the propagation network to obtain the coding features corresponding to the associated users; and to perform concatenation processing on the transform coding features and the coding features corresponding to the associated users to obtain the target coding features.

[0170] The user attribute inference device 50 provided in this embodiment of the invention can execute the technical solution of the user attribute inference method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the user attribute inference method. Please refer to the implementation principle and beneficial effects of the user attribute inference method. It will not be repeated here.

[0171] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions from the memory 630 to execute a training method for the user attribute inference model, or a user attribute inference method.

[0172] The training method for the user attribute inference model includes: obtaining tweet content samples from multiple users and corresponding attribute labels for each user; constructing a user relationship graph based on the tweet content samples from multiple users; encoding the tweet content samples from multiple users to obtain initial encoded features for each user; inputting the initial encoded features and user relationship graph from multiple users into the initial user attribute inference model to obtain the predicted attributes for each user; and updating the initial user attribute inference model based on the predicted attributes and attribute labels for each user to obtain the trained user attribute inference model.

[0173] The user attribute inference method includes: obtaining the target tweet content of the user to be inferred; encoding the target tweet content to obtain the initial encoded features corresponding to the user to be inferred; inputting the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of the above embodiments.

[0174] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0175] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the training method of the user attribute inference model provided by the above methods, or the user attribute inference method.

[0176] The training method for the user attribute inference model includes: obtaining tweet content samples from multiple users and corresponding attribute labels for each user; constructing a user relationship graph based on the tweet content samples from multiple users; encoding the tweet content samples from multiple users to obtain initial encoded features for each user; inputting the initial encoded features and user relationship graph from multiple users into the initial user attribute inference model to obtain the predicted attributes for each user; and updating the initial user attribute inference model based on the predicted attributes and attribute labels for each user to obtain the trained user attribute inference model.

[0177] The user attribute inference method includes: obtaining the target tweet content of the user to be inferred; encoding the target tweet content to obtain the initial encoded features corresponding to the user to be inferred; inputting the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of the above embodiments.

[0178] In another aspect, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a training method for a user attribute inference model provided by the above methods, or a user attribute inference method.

[0179] The training method for the user attribute inference model includes: obtaining tweet content samples from multiple users and corresponding attribute labels for each user; constructing a user relationship graph based on the tweet content samples from multiple users; encoding the tweet content samples from multiple users to obtain initial encoded features for each user; inputting the initial encoded features and user relationship graph from multiple users into the initial user attribute inference model to obtain the predicted attributes for each user; and updating the initial user attribute inference model based on the predicted attributes and attribute labels for each user to obtain the trained user attribute inference model.

[0180] The user attribute inference method includes: obtaining the target tweet content of the user to be inferred; encoding the target tweet content to obtain the initial encoded features corresponding to the user to be inferred; inputting the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of the above embodiments.

[0181] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A training method for a user attribute inference model, characterized in that, include: Obtain samples of tweets from multiple users, along with the corresponding attribute tags for each user; Based on the tweet content samples of the multiple users, construct a user relationship graph corresponding to the multiple users; Each of the multiple users' tweet content samples is encoded to obtain the initial encoding features corresponding to each of the multiple users; The initial encoded features corresponding to each of the multiple users and the user relationship graph are input into the initial user attribute inference model to obtain the predicted attributes corresponding to each user; The initial user attribute inference model is updated based on the predicted attributes and attribute labels corresponding to each user to obtain the trained user attribute inference model. The step of constructing a user relationship graph corresponding to the multiple users based on the tweet content samples of each user includes: Based on the tweet content samples of the multiple users, an initial user relationship graph corresponding to the multiple users is constructed; the construction of the initial user relationship graph based on the tweet content samples of the multiple users includes: determining the multiple users as user nodes in the initial user relationship graph, extracting users with interactive relationships from the tweet content samples of each user as neighbor nodes of the user in the initial user relationship graph, and constructing the initial user relationship graph of the user network with interactive relationships; the nodes in the initial user relationship graph include the multiple users and neighbor users with interactive relationships with the multiple users; The user relationship graph is obtained by removing user nodes that meet preset conditions from the initial user relationship graph; wherein, the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users; The initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network. The process of inputting the initial encoded features corresponding to each of the multiple users and the user relationship graph into the initial user attribute inference model to obtain the predicted attributes corresponding to each user includes: The following processing is performed on the initial encoded features corresponding to each user: The initial coding features are input into the transform network to obtain the transform coding features corresponding to the user; The transformed coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated users, and the associated users are users who have an association relationship with the user in the user relationship graph; The target encoded features are fed into the adaptive adjustment network to obtain the predicted attributes corresponding to the user.

2. The training method for the user attribute inference model according to claim 1, characterized in that, The step of inputting the transformed coding features and the user relationship graph into the propagation network to obtain the target coding features corresponding to the user includes: The transformed coding features and the user relationship graph are input into the propagation network to obtain the coding features corresponding to the associated users; The target coding feature is obtained by concatenating the transformed coding feature and the coding feature corresponding to the associated user.

3. The training method for the user attribute inference model according to claim 1 or 2, characterized in that, The process of obtaining samples of tweets from multiple users includes: For each user, obtain an initial tweet content sample corresponding to that user; The initial tweet content sample is sequentially subjected to denoising and word segmentation to obtain multiple initial word segments, and stop words are removed from the multiple initial word segments to obtain multiple target word segments; Based on the multiple target word segments, a sample of the tweet content corresponding to the user is generated.

4. The training method for the user attribute inference model according to claim 1 or 2, characterized in that, The step of updating the initial user attribute inference model based on the predicted attributes and attribute labels corresponding to each user includes: For each user, construct the cross-entropy loss corresponding to the user based on the predicted attribute and the attribute label corresponding to the user; The initial user attribute inference model is updated based on the cross-entropy loss corresponding to each user.

5. A method for inferring user attributes, characterized in that, include: Obtain the target tweet content of the user to be inferred; The target tweet content is encoded to obtain the initial encoded features corresponding to the user to be inferred; The initial encoded features and user relationship graph corresponding to the user to be inferred are input into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of claims 1-4 above.

6. The user attribute inference method according to claim 5, characterized in that, The step of inputting the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred includes: The initial encoded features are input into the transform network of the user attribute inference model to obtain the transformed encoded features corresponding to the user to be inferred; The transformed coding features and the user relationship graph are input into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated user; The target encoded features are fed into the adaptive adjustment network of the user attribute inference model to obtain the predicted attribute corresponding to the user to be inferred.

7. The user attribute inference method according to claim 6, characterized in that, The step of inputting the transformed coding features and the user relationship graph into the propagation network of the user attribute inference model to obtain the target coding features corresponding to the user to be inferred includes: The transformed coding features and the user relationship graph are input into the propagation network to obtain the coding features corresponding to the associated users; The target coding feature is obtained by concatenating the transformed coding feature and the coding feature corresponding to the associated user.

8. A training device for a user attribute inference model, characterized in that, include: The first acquisition unit is used to acquire samples of tweets from multiple users, as well as the attribute tags corresponding to each user; The construction unit is used to construct a user relationship graph corresponding to the multiple users based on the tweet content samples of each user. The first encoding unit is used to encode the tweet content samples of each of the multiple users respectively, so as to obtain the initial encoding features corresponding to each of the multiple users; The first processing unit is used to input the initial encoded features corresponding to each of the multiple users and the user relationship graph into the initial user attribute inference model to obtain the predicted attributes corresponding to each user; The update unit is used to update the initial user attribute inference model according to the predicted attributes and attribute labels corresponding to each user, so as to obtain the trained user attribute inference model. The construction unit is configured to construct a user relationship graph corresponding to the multiple users based on the tweet content samples of each user, including: Based on the tweet content samples of the multiple users, an initial user relationship graph corresponding to the multiple users is constructed; the construction of the initial user relationship graph based on the tweet content samples of the multiple users includes: determining the multiple users as user nodes in the initial user relationship graph, extracting users with interactive relationships from the tweet content samples of each user as neighbor nodes of the user in the initial user relationship graph, and constructing the initial user relationship graph of the user network with interactive relationships; the nodes in the initial user relationship graph include the multiple users and neighbor users with interactive relationships with the multiple users; The user relationship graph is obtained by removing user nodes that meet preset conditions from the initial user relationship graph; wherein, the preset conditions include a degree of 1, a degree greater than a preset threshold, and not belonging to at least one of the multiple users; The initial user attribute inference model includes a transformation network, a propagation network, and an adaptive adjustment network. The first processing unit is used to input the initial encoded features corresponding to each of the multiple users and the user relationship graph into the initial user attribute inference model to obtain the predicted attributes corresponding to each user, including: The following processing is performed on the initial encoded features corresponding to each user: The initial coding features are input into the transform network to obtain the transform coding features corresponding to the user; The transformed coding features and the user relationship graph are input into the propagation network to obtain the target coding features corresponding to the user; wherein, the target coding features include the transformed coding features and the coding features corresponding to the associated users, and the associated users are users who have an association relationship with the user in the user relationship graph; The target encoded features are fed into the adaptive adjustment network to obtain the predicted attributes corresponding to the user.

9. A user attribute inference device, characterized in that, include: The second acquisition unit is used to acquire the target tweet content of the user to be inferred. The second encoding unit is used to encode the target tweet content to obtain the initial encoding features corresponding to the user to be inferred; The second processing unit is used to input the initial encoded features and user relationship graph corresponding to the user to be inferred into the user attribute inference model to obtain the predicted attributes corresponding to the user to be inferred. The user relationship graph includes the user node of the user to be inferred and the user nodes of related users who have a relationship with the user to be inferred. The user attribute inference model is the user attribute inference model trained by any one of claims 1-5 above.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the training method of the user attribute inference model as described in any one of claims 1 to 4; or, when the processor executes the program, it implements the user attribute inference method as described in any one of claims 5 to 7.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the training method of the user attribute inference model as described in any one of claims 1 to 4, or, when executed, it implements the user attribute inference method as described in any one of claims 5 to 7.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method of the user attribute inference model as described in any one of claims 1 to 4; or, when executed, it implements the user attribute inference method as described in any one of claims 5 to 7.

Citation Information

Patent Citations

  • Social network user attribute prediction method and system based on graph generation

    CN114741515A

  • Social robot detection algorithm based on user semantics, attributes and neighborhood information

    CN115309813A