Character social relationship judgment method and device
By adding two additional linear transformation layers to the full connection layer, combining the pre-processing annotation of social data and training of deep learning models, the problem of insufficient efficiency and accuracy of character social relationship judgment analysis in the existing technology is solved, and accurate judgment and efficient analysis of social relationships are achieved.
Patent Information
- Application Number
- CN202411556041.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art is difficult to improve the efficiency and accuracy of character social relationship judgment analysis, especially in the face of the diversity and complexity of social data.
Using a multimodal fusion architecture, the accurate judgment of social relationships is achieved by adding two additional linear transformation layers before the fully connected layer, combining pre-processing annotation of social data and training of deep learning models.
It realizes accurate judgment of social relations, improves analysis efficiency and accuracy, is suitable for different social platforms and user groups, and has strong versatility and scalability.
Smart Images

Figure CN119577358A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data analysis, and specifically provides a method and device for determining the social relationship of a person. Background Art
[0002] In modern society, most interpersonal communication is done through social apps and telephone calls. The explosive growth of social data and the emergence of big model technology have provided a basis for determining people's social relationships through big model technology and social settings.
[0003] How to improve the work efficiency of relevant analysts while ensuring the accuracy of analysis results is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0004] The present invention aims at solving the above-mentioned deficiencies of the prior art and provides a method for determining the social relationship of characters with strong practicality.
[0005] A further technical task of the present invention is to provide a device for determining the social relationship of characters that is reasonably designed, safe and applicable.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A method for determining social relations of characters comprises the following steps:
[0008] S1. Collecting social data with clear social relationships;
[0009] S2. Pre-process and annotate the collected social data;
[0010] S3, choose a multimodal fusion architecture and add two additional linear transformation layers before the fully connected layer;
[0011] S4, train the model and divide it into training set and validation set;
[0012] S5. Conduct trial production and call the model to determine the social relationship of the input social data;
[0013] S6. During formal use, results that do not meet the requirements must be manually corrected and recorded.
[0014] Furthermore, in step S2, when pre-processing annotation is performed, the annotated content includes mutual social relations, frequency, duration, and time point distribution of social interactions, and at the same time, the "jargon" of different regions and industry fields is translated into "vernacular".
[0015] Furthermore, in step S3, assuming that the length of the input sequence is T and the dimension of the input sequence is d model , the decoder’s hidden layer size is d hidden, the dimension of the output sequence is d output ;
[0016] Further including:
[0017] S3-1, input processing;
[0018] S3-2, add the first fully connected layer;
[0019] S3-3, add a second fully connected layer;
[0020] S3-4. Output processing.
[0021] Furthermore, in step S3-1, assume that the input sequence of the decoder is X∈R T×dmodel , where X is a T×d model A matrix where each row represents an input vector;
[0022] In step S3-2, after the last layer of self-attention or encoder-decoder attention mechanism of the decoder, a fully connected layer is added, and the weight matrix of this fully connected layer is W 1 ∈R dmodel×dhidden , the bias vector is b 1 ∈R dhidden , the input sequence X and the weight matrix W 1 Multiply, and add the bias vector b 1 , then, apply the activation function f:
[0023] H 1 =f(XW 1 +b 1 ) where H 1 ∈R T×dhidden .
[0024] Further, in step S3-3, after the output of the first fully connected layer, another fully connected layer is added, and the weight matrix of this second fully connected layer is W 2 ∈R dhidden×doutput , the bias vector is b2∈R doutput , the output H of the first fully connected layer 1 With the weight matrix W 2 Multiply, and add the bias vector b 2 :
[0025] H 2 =H 1 W 2 +b 2 , where H 2 ∈R T×doutput ;
[0026] In step S3-4, the output H of the second fully connected layer is 2 Passed to the loss function for training and used to generate prediction results.
[0027] Furthermore, in step S4, 90% of the processed training data is used as a training set, and the remaining 10% is used as a validation set. For a general model, trial production can be carried out when the model accuracy reaches 90%.
[0028] Furthermore, in step S5, the model is called to determine the social relationships of the input social data. The social data of a certain number of people are selected each time, and a certain number of people are randomly selected from each person's social objects to verify the social relationships. If the accuracy rate is lower than 90%, the model parameters need to be adjusted for a new round of training. If the accuracy rate is stable at more than 90% after several consecutive trial runs, it can be officially put into use.
[0029] Furthermore, in step S6, the results that do not meet the requirements are manually corrected and recorded. After reaching a certain number, the result data are put into the training library again, and then the model is retrained to match the model with the current business.
[0030] A device for determining social relations of characters, comprising: at least one memory and at least one processor;
[0031] The at least one memory is used to store a machine-readable program;
[0032] The at least one processor is used to call the machine-readable program to execute a method for determining the social relationship of characters.
[0033] Compared with the prior art, the method and device for determining social relations of characters of the present invention have the following outstanding beneficial effects:
[0034] The present invention uses deep learning of large models and feature extraction of social data, and conducts analysis based on multiple factors such as social content, time, frequency, and time point distribution, so as to achieve accurate judgment of social relationships.
[0035] This method can adapt to social data from different social platforms and different user groups, and has strong versatility and scalability.
[0036] It can provide technical support for social network analysis, user behavior prediction and other fields, and has important practical application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are 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.
[0038] Attached Figure 1 It is a flowchart of a method for determining social relations of characters. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] A best embodiment is given below:
[0041] like Figure 1 As shown, a method for determining social relations of characters in this embodiment has the following steps:
[0042] S1. Collecting social data with clear social relationships;
[0043] S2. Pre-process and annotate the collected social data;
[0044] During pre-processing annotation, the annotation content includes mutual social relations, frequency, duration, and time point distribution of social interactions. At the same time, the "jargon" of different regions and industries is translated into "vernacular". For example, Xiaochilao in Shanghai corresponds to young people, and Zuodan in the catering industry means leaving without paying after ordering.
[0045] S3, choose a multimodal fusion architecture, in order to enhance the representation ability of the model, improve the performance and accuracy of the model, add two additional linear transformation layers before the fully connected layer;
[0046] Assume that the length of the input sequence is T and the dimension of the input sequence is d model , the size of the decoder hidden layer is d hidden , the dimension of the output sequence is d output .
[0047] S3-1. Input processing, assuming that the decoder input sequence is X∈R T×dmodel , where X is a T×d model A matrix where each row represents an input vector;
[0048] S3-2, add the first fully connected layer, add a fully connected layer after the last layer of self-attention or encoder-decoder attention mechanism of the decoder. The weight matrix of this fully connected layer is W 1 ∈R dmodel×dhidden , the bias vector is b 1 ∈R dhidden . Combine the input sequence X with the weight matrix W 1 Multiply, and add the bias vector b 1 , and then apply the activation function f:
[0049] H 1 =f(XW 1 +b 1 ) where H 1 ∈R T×dhidden .
[0050] S3-3. Add a second fully connected layer: Add another fully connected layer after the output of the first fully connected layer. The weight matrix of this second fully connected layer is W 2 ∈R dhidden×doutput , the bias vector is b2∈R doutput . The output H of the first fully connected layer 1 With the weight matrix W 2 Multiply, and add the bias vector b 2 :
[0051] H 2 =H 1 W 2 +b 2 , where H 2 ∈R T×doutput .
[0052] S3-4. Conduct model training, use 90% of the processed training data as the training set, and the remaining 10% as the validation set. For general models, trial production can be carried out when the model accuracy reaches 90%.
[0053] S4, train the model and divide it into training set and validation set;
[0054] 90% of the processed training data is used as the training set, and the remaining 10% is used as the validation set. For general models, trial production can be carried out when the model accuracy reaches 90%.
[0055] S5. Conduct trial production and call the model to determine the social relationship of the input social data;
[0056] The social data of 5 people are selected each time, and 10 people are randomly selected from each person’s social objects for social relationship verification. If the accuracy rate is lower than 90%, the model parameters need to be adjusted for a new round of training. If the accuracy rate is stable at more than 90% after 5 consecutive trial productions, it can be officially put into use.
[0057] S6. During the formal use process, any results that do not meet the requirements must be manually corrected and recorded;
[0058] After reaching a certain number, the result data will be put into the training library again, and then the model will be retrained to match the model with the current business.
[0059] Based on the above method, a device for determining social relations between characters in this embodiment includes: at least one memory and at least one processor;
[0060] The at least one memory is used to store a machine-readable program;
[0061] The at least one processor is used to call the machine-readable program to execute a method for determining the social relationship of characters.
[0062] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that conform to the above-mentioned specific implementations of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.
[0063] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for determining social relations of characters, characterized in that: The steps are as follows: S1. Collecting social data with clear social relationships; S2. Pre-process and annotate the collected social data; S3, choose a multimodal fusion architecture and add two additional linear transformation layers before the fully connected layer; S4, train the model and divide it into training set and validation set; S5. Conduct trial production and call the model to determine the social relationship of the input social data; S6. During formal use, results that do not meet the requirements must be manually corrected and recorded.
2. A method for determining social relations of characters according to claim 1, characterized in that: In step S2, when pre-processing annotation is performed, the annotated content includes mutual social relations, frequency, duration, and time point distribution of social interactions, and at the same time, the "jargon" of different regions and industry fields is translated into "vernacular".
3. A method for determining social relations of characters according to claim 2, characterized in that: In step S3, assume that the length of the input sequence is T and the dimension of the input sequence is d model , the size of the decoder hidden layer is d hidden , the dimension of the output sequence is d output ; Further including: S3-1, input processing; S3-2, add the first fully connected layer; S3-3, add a second fully connected layer; S3-4. Output processing.
4. A method for determining social relations of characters according to claim 3, characterized in that: In step S3-1, assume that the input sequence of the decoder is X∈R T×dmodel , where X is a T×d model A matrix where each row represents an input vector; In step S3-2, after the last layer of self-attention or encoder-decoder attention mechanism of the decoder, a fully connected layer is added, and the weight matrix of this fully connected layer is W1∈R dmodel×dhidden , the bias vector is b1∈R dhidden , multiply the input sequence X by the weight matrix W1, add the bias vector b1, and then apply the activation function f: H1=f(XW1+b1)where H1∈R T×dhidden .
5. A method for determining social relations of characters according to claim 4, characterized in that: In step S3-3, after the output of the first fully connected layer, another fully connected layer is added. The weight matrix of this second fully connected layer is W2∈R dhidden×doutput , the bias vector is b2∈R doutput , multiply the output H1 of the first fully connected layer by the weight matrix W2, and add the bias vector b2: H2=H1W2+b2, where H2∈R T×doutput ; In step S3-4, the output H2 of the second fully connected layer is passed to the loss function for training to generate prediction results.
6. A method for determining social relations of characters according to claim 5, characterized in that: In step S4, 90% of the processed training data is used as a training set, and the remaining 10% is used as a validation set. For a general model, trial production can be carried out when the model accuracy reaches 90%.
7. A method for determining social relations of characters according to claim 6, characterized in that: In step S5, the model is called to determine the social relationships of the input social data. The social data of a certain number of people are selected each time, and a certain number of people are randomly selected from each person's social objects to verify the social relationships. If the accuracy rate is lower than 90%, the model parameters need to be adjusted for a new round of training. If the accuracy rate is stable at above 90% after several consecutive trial runs, it can be officially put into use.
8. A method for determining social relations of characters according to claim 7, characterized in that: In step S6, the results that do not meet the requirements are manually corrected and recorded. After reaching a certain number, the result data are put into the training library again, and then the model is retrained to match the model with the current business.
9. A device for determining social relations between people, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Social relationship prediction system and method based on mobile phone evidence obtaining data
CN106778851A
Training method and recognition method of social relation recognition model and related equipment
CN112668509A
Social relation analysis method and system based on multi-modal data and storage medium
CN115293920A
Data field generation method and device based on large model
CN118606317A
Transform-based social message outbreak prediction method
CN118735027A