Character character analysis method and device, electronic equipment and medium

By analyzing the emotions and personality characteristics in the chat records between the target object and multiple interlocutors, the problem of vague personality description in the existing technology is solved, and a more accurate personality portrait is achieved.

CN120654682APending Publication Date: 2025-09-16SHENZHEN HUIYANG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511049191.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

It is difficult to obtain a specific, detailed and accurate description of a person's personality through text analysis in online social networking with existing technologies.

Method used

By obtaining the chat records between the target object and multiple interlocutors, the tone in each chat record is identified, the emotions of the target object and the interlocutors are determined, and a personality profile is constructed based on these emotions and personality trait values.

Benefits of technology

It achieves a more specific, detailed and accurate description of the target object's personality, and generates a fuller personality portrait by analyzing the emotions and personality characteristics in the chat records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654682A_ABST
    Figure CN120654682A_ABST
Patent Text Reader

Abstract

The invention relates to a character character analysis method and device, electronic equipment and a medium, and relates to the field of natural language processing, and the method comprises the steps: obtaining chat records corresponding to a target object and a plurality of dialogues, and determining the preference character of the target object based on all chat records, performing tone recognition on statements of the target object and the dialogue person in each chat record to obtain a first emotion of the target object and a second emotion of the dialogue person corresponding to each chat record, and determining a preference emotion of the target object based on the first emotion and the second emotion, and determining a character feature value of the target object based on the preference emotion and the preference character, and determining a character portrait of the target object based on the feature value. According to the method, more specific, detailed and accurate character description can be obtained according to the text about the character.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing, and in particular to a method, device, electronic device, and medium for analyzing human personality. Background Art

[0002] With the development of online virtual social interaction, analyzing a person's personality through their interactions and other behaviors has become a growing research hotspot. Analyzing a person's personality based on their interactions can help understand their physical and mental health or provide targeted information, thereby enhancing their experience in online social activities. Several techniques for analyzing a person's personality have emerged, such as semantically analyzing text related to the person. However, the personality obtained through such methods is relatively one-sided and lacks specificity, and the resulting personality description is also relatively general and lacks precision. Therefore, how to obtain a more specific, detailed, and accurate personality description based on text about a person has become a challenge. Summary of the Invention

[0003] In order to obtain a more specific, detailed and accurate character description based on a text about a character, the present application provides a character personality analysis method.

[0004] In a first aspect, the present application provides a method for character analysis, which employs the following technical solutions: A character analysis method, comprising: Obtaining chat records corresponding to the target object and multiple interlocutors, and determining the target object's preferred personality based on all chat records; Perform tone recognition on the target object and the interlocutor's sentences in each chat record, and obtain the target object's first emotion and the interlocutor's second emotion corresponding to each chat record; determining the target object's preferred emotion based on the first emotion and the second emotion; The personality characteristic value of the target object is determined based on the preferred emotion and the preferred personality, and the personality portrait of the target object is determined based on the personality characteristic value.

[0005] By adopting the above technical solution, the chat records between the target object and multiple interlocutors are obtained, thereby obtaining a large amount of communication texts. Based on the large amount of communication texts, it is convenient to subsequently accurately analyze the target object's preferred personality. The tone of voice is recognized by the corresponding sentences of the target object and the interlocutor in each chat record, and the first emotion of the target object and the second emotion of the interlocutor are obtained. The second emotion of the interlocutor may affect the preferred emotion of the target object. Therefore, the preferred emotion of the target object can be determined based on the first emotion and the second emotion of each chat record. There is an influence relationship between the preferred emotion and the preferred personality of the character. Therefore, the preferred emotion can make the target object's personality fuller and the personality portrait more accurate and detailed. Therefore, the target object's personality characteristic value is determined based on the target object's preferred emotion and preferred personality. The personality portrait of the target object determined based on the personality characteristic value is more specific, detailed and accurate.

[0006] In another possible implementation, determining the target object's preferred personality based on all chat records includes: Determining the emoticons posted by the target object in each chat record, and performing word segmentation processing on the sentences of the target object in each chat record to obtain a word set related to each chat record; Filtering the number of words in a preset vocabulary for each personality from the word set, and determining the first personality of the target object with respect to each chat record based on the number of words; Determine a preset number of target emoticon packages that are used the most times by the target object from the emoticon packages in all chat records; Determine a preset emoji package library that each target emoji package hits, and determine a preset personality corresponding to the target preset emoji package library, and determine the preset personality as a second personality, wherein the target preset emoji package library is the preset emoji package library that hits the most target emoji packages, and each preset emoji package library corresponds to a personality; Determine the target first personality whose first personality appears most frequently from all chat records; If the target first personality is consistent with the second personality, determining the preferred personality as the target first personality; If the target first personality is inconsistent with the second personality, determining the correlation between the target first personality and the second personality, determining from all chat records an alternative personality whose first personality appears second only to the target first personality, and determining the correlation between the alternative personality and the second personality, wherein the correlation represents the degree of similarity between each personality and the other personality; Determine the extroversion degree value of the target object based on the statements of the target object and the statements of the interlocutor in each chat record; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value; and determining a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value; The preferred personality is determined from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality.

[0007] In another possible implementation, determining the extroversion value of the target object based on the target object's statements and the interlocutor's statements in each chat record includes any one of the following: Input each chat record into the trained network model to calculate the extroversion degree, obtain the sub-extroversion degree value of each chat record, and average the sub-extroversion degree values ​​of all chat records to obtain the extroversion degree value of the target object; or, Determine the proportion of questions in the messages sent by the target object in each chat record, and determine the average number of words in the target object's answers based on the number of words in each answer sentence. Determine a first ratio of the total number of messages from the interlocutors to the total number of messages from the target object in each chat record. Determine the sub-extroversion value of the target object for each chat record based on the proportion of questions, the average number of words in the answers, and the first ratio. Average the sub-extroversion values ​​of all chat records to obtain the extroversion value of the target object.

[0008] In another possible implementation, each personality has a preset extroversion value corresponding to it. Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value, and determining a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value, includes: Calculating a first difference between a preset extroversion value of the target first personality and the extroversion value of the target object; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the correlation between the target first personality and the second personality, the first difference, and the respective corresponding coefficients; Calculating a second difference between the preset extroversion value of the candidate personality and the extroversion value of the target object; A second possibility that the alternative personality belongs to the preferred personality is determined based on the number of occurrences of the alternative personality, the correlation between the alternative personality and the second personality, the second difference, and the respective corresponding coefficients.

[0009] In another possible implementation, determining the preferred personality from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality includes: determining a third difference between the extroversion value of the second personality and the extroversion value of the target object; Determine a difference between the third difference and the first difference to obtain a fourth difference with respect to the first difference; determining a difference between the third difference and the second difference to obtain a fifth difference with respect to the second difference; Correcting the first possibility based on the fourth difference to obtain a corrected first possibility, and correcting the second possibility based on the fifth difference to obtain a corrected second possibility; The personality corresponding to the maximum value between the modified first possibility and the modified second possibility is determined as the preferred personality.

[0010] In another possible implementation, determining the target object's preferred emotion based on the first emotion and the second emotion includes: Determine a first target chat record in which the first emotion and the second emotion are consistent, and determine a second target chat record in which the first emotion and the second emotion are inconsistent; Determining a first proportion of the number of occurrences of each first emotion in all first emotions of the target object, and determining the target first emotion with the highest first proportion; If the first proportion of the target first emotion does not reach the preset proportion threshold, and there is a candidate first emotion whose difference with the first proportion of the target first emotion is less than the preset difference threshold, then determining a first number belonging to the target first emotion from the first target chat record, and determining a second number belonging to the target first emotion from the second target chat record; Determine a second ratio of the first number to the total number of first target chat records, and determine a third ratio of the second number to the total number of second target chat records; Correcting the first proportion of the target first emotion based on the second proportion and the third proportion to obtain a corrected first proportion of the target first emotion; Determine a third number of first emotions to be selected from the first target chat record, and determine a fourth number of first emotions to be selected from the second target chat record; Determine a fourth ratio of the third number to the total number of first target chat records, and determine a fifth ratio of the fourth number to the total number of second target chat records; Correcting the first proportion of the first emotion to be selected based on the fourth proportion and the fifth proportion to obtain a corrected first proportion of the first emotion to be selected; The first emotion corresponding to the maximum value between the first proportion after correction of the target first emotion and the first proportion after correction of the candidate first emotion is determined as the preferred emotion.

[0011] In another possible implementation, determining the personality characteristic value of the target object based on the preferred emotion and the preferred personality, and determining the personality profile of the target object based on the personality characteristic value includes: Obtaining the possibility that the target object belongs to the preferred personality and the first proportion after correction of the preferred emotion; Determining a second ratio of the likelihood to the first corrected ratio of the preferred emotion, the second ratio representing a personality trait value of the target object with respect to personality; Searching a plurality of candidate personality description texts that satisfy the preferred emotions and preferred personalities from a preset database, wherein the preset database includes a plurality of preset personality description texts, each of which corresponds to a personality, an emotion, and personality characteristic values ​​related to the personality and the emotion; Determining a screening interval for the personality characteristic value based on the personality characteristic value and a preset interval range, and screening a target personality description text that hits the screening interval from the personality characteristic values ​​of the plurality of candidate personality description texts; All target personality description texts are fused to obtain the personality portrait of the target object.

[0012] In a second aspect, the present application provides a method and device for analyzing a person's personality, which adopts the following technical solution: A method and device for analyzing a person's personality, comprising: A personality determination module is used to obtain chat records corresponding to the target object and multiple interlocutors, and determine the preferred personality of the target object based on all chat records; A tone recognition module is used to perform tone recognition on the sentences of the target object and the interlocutor in each chat record, and obtain the first emotion of the target object and the second emotion of the interlocutor corresponding to each chat record; An emotion determination module, configured to determine the target object's preferred emotion based on the first emotion and the second emotion; The personality portrait determination module is used to determine the personality characteristic value of the target object based on the preferred emotion and preferred personality, and to determine the personality portrait of the target object based on the personality characteristic value.

[0013] By adopting the above technical solution, the personality determination module obtains the chat records between the target object and multiple interlocutors to obtain a large amount of communication texts. Based on the large amount of communication texts, it is convenient to subsequently accurately analyze the preferred personality of the target object. The tone recognition module performs tone recognition on the corresponding sentences of the target object and the interlocutor in each chat record to obtain the first emotion of the target object and the second emotion of the interlocutor. The second emotion of the interlocutor may affect the preferred emotion of the target object. Therefore, the emotion determination module can determine the preferred emotion of the target object based on the first emotion and the second emotion of each chat record. There is an influence relationship between the preferred emotion and the preferred personality of the character. Therefore, the preferred emotion can make the personality of the target object fuller and the personality portrait more accurate and detailed. Therefore, the personality portrait determination module determines the personality characteristic value of the target object based on the preferred emotion and preferred personality of the target object. The personality portrait of the target object determined based on the personality characteristic value is more specific, detailed and accurate.

[0014] In another possible implementation, when determining the target object's preferred personality based on all chat records, the personality determination module is specifically configured to: Determining the emoticons posted by the target object in each chat record, and performing word segmentation processing on the sentences of the target object in each chat record to obtain a word set related to each chat record; Filtering the number of words in a preset vocabulary for each personality from the word set, and determining the first personality of the target object with respect to each chat record based on the number of words; Determine a preset number of target emoticon packages that are used the most times by the target object from the emoticon packages in all chat records; Determine a preset emoji package library that each target emoji package hits, and determine a preset personality corresponding to the target preset emoji package library, and determine the preset personality as a second personality, wherein the target preset emoji package library is the preset emoji package library that hits the most target emoji packages, and each preset emoji package library corresponds to a personality; Determine the target first personality whose first personality appears most frequently from all chat records; If the target first personality is consistent with the second personality, determining the preferred personality as the target first personality; If the target first personality is inconsistent with the second personality, determining the correlation between the target first personality and the second personality, determining from all chat records an alternative personality whose first personality appears second only to the target first personality, and determining the correlation between the alternative personality and the second personality, wherein the correlation represents the degree of similarity between each personality and the other personality; Determine the extroversion degree value of the target object based on the statements of the target object and the statements of the interlocutor in each chat record; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value; and determining a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value; The preferred personality is determined from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality.

[0015] In another possible implementation, when the personality determination module determines the extroversion value of the target object based on the target object's statements and the interlocutor's statements in each chat record, it is specifically used for any of the following: Input each chat record into the trained network model to calculate the extroversion degree, obtain the sub-extroversion degree value of each chat record, and average the sub-extroversion degree values ​​of all chat records to obtain the extroversion degree value of the target object; or, Determine the proportion of questions in the messages sent by the target object in each chat record, and determine the average number of words in the target object's answers based on the number of words in each answer sentence. Determine a first ratio of the total number of messages from the interlocutors to the total number of messages from the target object in each chat record. Determine the sub-extroversion value of the target object for each chat record based on the proportion of questions, the average number of words in the answers, and the first ratio. Average the sub-extroversion values ​​of all chat records to obtain the extroversion value of the target object.

[0016] In another possible implementation, each personality has a preset extroversion value corresponding to it. The personality determination module, when determining a first possibility that the target first personality is a preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value, and determining a second possibility that the alternative personality is a preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value, is specifically configured to: Calculating a first difference between a preset extroversion value of the target first personality and the extroversion value of the target object; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the correlation between the target first personality and the second personality, the first difference, and the respective corresponding coefficients; Calculating a second difference between the preset extroversion value of the candidate personality and the extroversion value of the target object; A second possibility that the alternative personality belongs to the preferred personality is determined based on the number of occurrences of the alternative personality, the correlation between the alternative personality and the second personality, the second difference, and the respective corresponding coefficients.

[0017] In another possible implementation, when the personality determination module determines the preferred personality from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality, it is specifically configured to: determining a third difference between the extroversion value of the second personality and the extroversion value of the target object; Determine a difference between the third difference and the first difference to obtain a fourth difference with respect to the first difference; determining a difference between the third difference and the second difference to obtain a fifth difference with respect to the second difference; Correcting the first possibility based on the fourth difference to obtain a corrected first possibility, and correcting the second possibility based on the fifth difference to obtain a corrected second possibility; The personality corresponding to the maximum value between the modified first possibility and the modified second possibility is determined as the preferred personality.

[0018] In another possible implementation, when the emotion determination module determines the preferred emotion of the target object based on the first emotion and the second emotion, it is specifically configured to: Determine a first target chat record in which the first emotion and the second emotion are consistent, and determine a second target chat record in which the first emotion and the second emotion are inconsistent; Determining a first proportion of the number of occurrences of each first emotion in all first emotions of the target object, and determining the target first emotion with the highest first proportion; If the first proportion of the target first emotion does not reach the preset proportion threshold, and there is a candidate first emotion whose difference with the first proportion of the target first emotion is less than the preset difference threshold, then determining a first number belonging to the target first emotion from the first target chat record, and determining a second number belonging to the target first emotion from the second target chat record; Determine a second ratio of the first number to the total number of first target chat records, and determine a third ratio of the second number to the total number of second target chat records; Correcting the first proportion of the target first emotion based on the second proportion and the third proportion to obtain a corrected first proportion of the target first emotion; Determine a third number of first emotions to be selected from the first target chat record, and determine a fourth number of first emotions to be selected from the second target chat record; Determine a fourth ratio of the third number to the total number of first target chat records, and determine a fifth ratio of the fourth number to the total number of second target chat records; Correcting the first proportion of the first emotion to be selected based on the fourth proportion and the fifth proportion to obtain a corrected first proportion of the first emotion to be selected; The first emotion corresponding to the maximum value between the first proportion after correction of the target first emotion and the first proportion after correction of the candidate first emotion is determined as the preferred emotion.

[0019] In another possible implementation, when the personality profile determination module determines the personality characteristic value of the target object based on the preferred emotion and the preferred personality, and determines the personality profile of the target object based on the personality characteristic value, it is specifically configured to: Obtaining the possibility that the target object belongs to the preferred personality and the first proportion after correction of the preferred emotion; Determining a second ratio of the likelihood to the first corrected ratio of the preferred emotion, the second ratio representing a personality trait value of the target object with respect to personality; Searching a plurality of candidate personality description texts that satisfy the preferred emotions and preferred personalities from a preset database, wherein the preset database includes a plurality of preset personality description texts, each of which corresponds to a personality, an emotion, and personality characteristic values ​​related to the personality and the emotion; Determining a screening interval for the personality characteristic value based on the personality characteristic value and a preset interval range, and screening a target personality description text that hits the screening interval from the personality characteristic values ​​of the plurality of candidate personality description texts; All target personality description texts are fused to obtain the personality portrait of the target object.

[0020] In a third aspect, the present application provides an electronic device, which adopts the following technical solution: An electronic device, comprising: at least one processor; Memory; At least one application, wherein at least one application is stored in a memory and configured to be executed by at least one processor, and at least one is configured to: execute a character analysis method described in any possible implementation of the first aspect.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium, when the computer program is executed in a computer, causes the computer to execute a character analysis method according to any one of the first aspects.

[0022] In summary, this application includes at least one of the following beneficial technical effects: The chat records between the target object and multiple interlocutors are obtained to obtain a large amount of communication texts. Based on the large amount of communication texts, it is convenient to subsequently accurately analyze the target object's preferred personality. The tone of voice is recognized by the corresponding sentences of the target object and the interlocutor in each chat record, and the first emotion of the target object and the second emotion of the interlocutor are obtained. The second emotion of the interlocutor may affect the preferred emotion of the target object. Therefore, the preferred emotion of the target object can be determined based on the first emotion and the second emotion of each chat record. There is an influence relationship between the preferred emotion and the preferred personality of the character. Therefore, the preferred emotion can make the target object's personality fuller and the personality portrait more accurate and detailed. Therefore, the target object's personality characteristic value is determined based on the target object's preferred emotion and preferred personality. The personality portrait of the target object determined based on the personality characteristic value is more specific, detailed and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a flowchart of a method for analyzing a person's personality according to an embodiment of the present application.

[0024] Figure 2 It is a structural diagram of a device for analyzing a person's personality according to an embodiment of the present application.

[0025] Figure 3 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The present application is further described in detail below with reference to the accompanying drawings.

[0027] After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.

[0028] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0029] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.

[0030] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.

[0031] The embodiment of the present application provides a method for analyzing a person's personality, which is executed by an electronic device, which can be a server or a terminal device, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application. Figure 1 As shown, the method includes steps S101, S102, S103 and S104, wherein: S101, obtaining chat records corresponding to a target object and multiple interlocutors, and determining the target object's preferred personality based on all chat records.

[0032] In an embodiment of the present application, a target object communicates with multiple interlocutors through the same social software, thereby generating chat records within the social software. The chat records corresponding to each of the target object and the multiple interlocutors can be stored in a cloud server. An electronic device is connected to the cloud server to retrieve the target object's chat records from the cloud server. Each chat record is a record of a chat between the target object and a single interlocutor. The chat records record the specific content of the communication between the target object and the interlocutor. Therefore, each chat record can reflect the target object's personality to a certain extent, and the target object's preferred personality can be accurately determined based on all the chat records.

[0033] S102, performing tone recognition on the sentences of the target object and the interlocutor in each chat record respectively, and obtaining the first emotion of the target object and the second emotion of the interlocutor corresponding to each chat record.

[0034] In the embodiment of the present application, the electronic device can separate the sentences of the target object and the interlocutor in each chat record, and then input all the sentences of the target object into the trained network model for tone recognition, thereby obtaining the first emotion of the target object in each chat record. In the same way, the electronic device can determine the second emotion of the interlocutor in each chat record. Specifically, the network model can be a convolutional neural network model, a recurrent neural network model, or other types of network models. The method of using a neural network model to recognize the tone of a sentence is a prior art and will not be repeated here.

[0035] S103: Determine the target object's preferred emotion based on the first emotion and the second emotion.

[0036] In the embodiment of the present application, the second emotion of the interlocutor during communication will affect the emotion of the target object to a certain extent, and the emotion of the target object will affect the character of the target object. Therefore, the electronic device can accurately determine the target object's preferred emotion based on the first emotion and the second emotion determined by each chat record.

[0037] S104: determining a personality characteristic value of the target object based on the preferred emotion and the preferred personality, and determining a personality profile of the target object based on the personality characteristic value.

[0038] In the embodiments of the present application, the target subject's preferred emotions are a deeper expression of their preferred personality. Based on these preferred emotions and personality, the target subject's personality can be more fully developed. Therefore, the electronic device determines the target subject's personality trait values ​​based on their preferred emotions and personality. These trait values ​​are specific and more representative of the target subject's personality. Based on these trait values, the electronic device can determine a personality profile that better fits the target subject, making the description of the personality profile more comprehensive, detailed, and accurate.

[0039] In a possible implementation of the embodiment of the present application, step S101 determines the target object's preferred personality based on all chat records, specifically including step S1011 (not shown in the figure), step S1012 (not shown in the figure), step S1013 (not shown in the figure), step S1014 (not shown in the figure), step S1015 (not shown in the figure), step S1016 (not shown in the figure), step S1017 (not shown in the figure), step S1018 (not shown in the figure), step S1019 (not shown in the figure) and step S10110 (not shown in the figure), wherein, S1011, determining the emoticons released by the target object in each chat record, and performing word segmentation processing on the sentences of the target object in each chat record to obtain a word set related to each chat record.

[0040] With the development of online virtual social networking, various forms of communication are becoming more and more popular. The use of emoticons has become very mature and widely integrated into online virtual social networking. The emoticons used by the target object can be used to analyze the target object's possible personality to a certain extent. For example, some cute and funny emoticons usually correspond to personalities such as "enthusiasm" and "optimism", while some melancholic and anxious emoticons usually correspond to personalities such as "indifference" and "pessimism". Therefore, the electronic device filters out the emoticons posted by the target object from each chat record of the target object.

[0041] By segmenting the target user's sentences, a word set is generated for each chat record. The words used by the target user in communication can also reflect their personality to a certain extent. Specifically, the electronic device can segment the words using Jieba, N-gram language models, hidden Markov models (HMMs), and conditional random fields (CRFs) to generate a word set for each chat record.

[0042] S1012, filtering out the number of words in the preset vocabulary for each personality from the word set, and determining the first personality of the target object with respect to each chat record based on the number of words.

[0043] In the embodiment of the present application, each personality has a corresponding preset vocabulary. For example, the preset vocabulary corresponding to the "enthusiastic" personality includes modal particles such as "ah, ah", as well as other words that represent "enthusiasm" such as "hehe, great", etc. The preset vocabulary corresponding to the "pessimistic" personality includes modal particles such as "ah, ah, forget it, after all, emo", etc., as well as other words that represent "pessimism" such as "horrible, sad, it's over", etc. The electronic device matches the word set of each chat record with the preset vocabulary of each personality, thereby obtaining the number of words in the word set of each chat record that hit the preset vocabulary of each personality. The personality with the largest number of hit words can be the primary personality reflected in each chat record.

[0044] S1013, determining a preset number of target emoticon packages that are used the most times by the target object from the emoticon packages in all chat records.

[0045] In the embodiment of the present application, a preset number is used as the minimum number of emoticon package samples. The more times a certain emoticon package is used, the more it can reflect the personality of the target object through this emoticon package. Therefore, the electronic device obtains emoticon packages of all chat records, counts the number of times each emoticon package is used, and sorts the emoticon packages from most to least according to the number of uses. According to the sorting result, a target emoticon package that reaches the preset number is determined. The personality analyzed by the target emoticon package is more consistent with the target object itself.

[0046] S1014, determining the preset emoticon package library hit by each target emoticon package, and determining the preset personality corresponding to the target preset emoticon package library, and determining the preset personality as the second personality.

[0047] Among them, the target preset emoticon package library is the preset emoticon package library with the most hit target emoticon packages, and each preset emoticon package library corresponds to a personality.

[0048] For the embodiment of the present application, the electronic device matches each target emoticon package with the preset emoticon package library for each personality, thereby obtaining the preset emoticon package library hit by each target emoticon package. The preset emoticon package library that hits the target emoticon package the most times is the target preset emoticon package library, that is, the personality represented by the target preset emoticon package library is most consistent with the target object. Therefore, the electronic device determines the preset personality corresponding to the target preset emoticon package library as the second personality.

[0049] S1015, determining the target first personality whose first personality appears most times from all chat records.

[0050] For the embodiment of the present application, after the electronic device determines the first personality of the target object corresponding to each chat record, it determines the target first personality that appears the most times from all chat records. The target first personality appears the most times, which indicates that it is more likely to be the preferred personality of the target object.

[0051] S1016: If the target first personality and the second personality are consistent, the preferred personality is determined to be the target first personality.

[0052] For the embodiment of the present application, the electronic device compares the target's first personality with the second personality. If the two are consistent, that is, the personality reflected by the words used by the target object in the chat is consistent with the personality reflected by the emoticon package, then it means that the target's first personality is the target object's preferred personality.

[0053] S1017, if the target's first personality and second personality are inconsistent, determine the correlation between the target's first personality and the second personality, determine from all chat records an alternative personality whose first personality appears the second most frequently after the target's first personality, and determine the correlation between the alternative personality and the second personality.

[0054] Among them, the correlation degree represents the similarity between each personality and other personalities.

[0055] In this embodiment of the present application, if the target's first and second personalities are inconsistent, the correlation between the target's first and second personalities is determined. The correlation between each personality and other personalities can be set by relevant personnel based on research and experiments. For example, the correlation between the personality "enthusiasm" and the personality "cheerfulness" is 90%, the correlation between the personality "enthusiasm" and the personality "indifference" is 10%, and the correlation between the personality "cheerfulness" and the personality "indifference" is 20%. In other words, the correlation represents the degree of similarity between two personalities. The closer the two personalities are to the two extremes, the lower the similarity between the two personalities. Therefore, the correlation can be used as a factor in determining the target object's true preferred personality.

[0056] After determining that the target's primary and secondary personalities are inconsistent, it's necessary to further determine the target's preferred personality. This involves identifying an alternative personality whose primary personality appears only second to the target's primary personality, and determining the correlation between the alternative personality and the secondary personality. This means selecting the personality that best matches the target's preferred personality from the target's primary and secondary personalities.

[0057] S1018: Determine the extroversion value of the target object based on the target object's statement and the interlocutor's statement in each chat record.

[0058] In the embodiments of the present application, different personalities are classified as extroverts or introverts. For example, "enthusiastic" and "cheerful" are extroverts, and the difference between them is the degree of extroversion. "Apathetic" and "pessimistic" are introverts, and the difference between them is also the degree of extroversion, but the degree of extroversion of introverts is lower than that of extroverts. The statements of the target object and the interlocutor in the chat record reflect the degree of introversion of the target object. Therefore, the extroversion value of the target object can be determined based on the statements of the target object and the interlocutor in each chat record.

[0059] S1019, based on the number of occurrences of the target first personality, the corresponding correlation degree and the extroversion value, a first possibility is determined that the target first personality belongs to the preferred personality, and based on the number of occurrences of the alternative personality, the corresponding correlation degree and the extroversion value, a second possibility is determined that the alternative personality belongs to the preferred personality.

[0060] In the embodiment of the present application, the more times the target's first personality appears, the greater the likelihood that it is the preferred personality. The higher the correlation between the target's first personality and the second personality, the greater the likelihood that it is the preferred personality. The target object's extroversion value also reflects the likelihood that the target's first personality is the preferred personality. Therefore, the electronic device determines the likelihood that the target's first personality is the preferred personality more accurately based on the number of times the target's first personality appears, the correlation between the target's first personality and the second personality, and the target object's extroversion value. This is the first likelihood. The electronic device similarly determines the second likelihood of the alternative personality.

[0061] S10110 , determining a preferred personality from the target first personality and the alternative personalities based on the first possibility, the second possibility, and the second personality.

[0062] In the embodiment of the present application, after the electronic device determines the first possibility and the second possibility, it further analyzes the first possibility and the second possibility in combination with the second personality to determine the preferred personality from the target first personality and the alternative personalities.

[0063] In a possible implementation of the embodiment of the present application, step S1018 determines the extroversion value of the target object based on the target object's statement and the interlocutor's statement in each chat record, including step 1 or step 2, wherein: Step 1: Input each chat record into the trained network model to calculate the extroversion degree, obtain the sub-extroversion degree value of each chat record, and average the sub-extroversion degree values ​​of all chat records to obtain the extroversion degree value of the target object.

[0064] Specifically, the network model can be a convolutional neural network model, a recurrent neural network model, or other types of network models, which are not limited here. Relevant personnel can pre-label a large number of chat record samples and the actual extroversion value of each chat record sample to obtain a training sample set. For example, one of the samples is "Chat Record 1, Extroversion Value 70." The training sample set is then used to perform supervised training on the initial network model to obtain a trained network model. After the electronic device determines the sub-extroversion value of each chat record, it uses the average calculation formula to calculate the average of the sub-extroversion values ​​for all the extroversion values. This average is the extroversion value of the target object.

[0065] Step 2: Determine the proportion of questions in the messages sent by the target object in each chat record, and determine the average number of words in the target object's answers based on the number of words in each answer sentence. Determine a first ratio of the total number of messages from the interlocutors in each chat record to the total number of messages from the target object. Determine the sub-extroversion value of the target object for each chat record based on the proportion of questions, the average number of words in the answers, and the first ratio. Average the sub-extroversion values ​​of all chat records to obtain the extroversion value of the target object.

[0066] In the embodiment of the present application, the greater the proportion of questions asked by the target subject in each chat record, the higher the target subject's willingness to actively communicate, which in turn indicates that the target subject is more extroverted. The electronic device determines the average number of words in the target subject's answers based on the number of words in each answer. The higher the average number of words, the more comprehensive the target subject's feedback on the interlocutor's questions or information, which in turn indicates that the target subject is more extroverted. The electronic device then determines a first ratio of the total number of messages sent by the interlocutor to the total number of messages sent by the target subject, with the total number of messages sent by the interlocutor as the denominator and the total number of messages sent by the target subject as the numerator. Therefore, the greater the first ratio, the more extroverted the target subject's communication is. In summary, the proportion of questions, the average number of words in the answers, and the first ratio are all key factors in characterizing the target subject's extroversion, and their influence on the extroversion degree varies. Therefore, relevant personnel set corresponding coefficients for the proportion of questions, the average number of words in the answers, and the first ratio and store them in the electronic device. The electronic device uses the corresponding coefficients to perform a weighted calculation on the proportion of questions, the average number of words in the answers, and the first ratio to obtain the target subject's sub-extroversion degree value. The electronic device then calculates an average value for all the sub-extroversion values ​​using an average value calculation formula, and the average value is the extroversion value of the target object.

[0067] In other embodiments, after determining the question percentage, the average word count of the answers, and the first ratio, the electronic device may input these three factors into a trained network model to calculate the extraversion value, ultimately obtaining a sub-extroversion value for each chat record. The electronic device then uses an average calculation formula to calculate an average value for all sub-extroversion values, which is the extraversion value of the target subject. The network model may be a convolutional neural network model, a recurrent neural network model, or another type of network model.

[0068] In one possible implementation of the embodiment of the present application, each personality corresponds to a preset extroversion value. In step S1019, a first possibility that the target first personality belongs to the preferred personality is determined based on the number of occurrences of the target first personality, the correlation corresponding to the target first personality, and the extroversion value. A second possibility that the alternative personality belongs to the preferred personality is determined based on the number of occurrences of the alternative personality, the correlation corresponding to the alternative personality, and the extroversion value. Specifically, the method includes steps Sa (not shown in the figure), Sb (not shown in the figure), Sc (not shown in the figure), and Sd (not shown in the figure), wherein: Sa, calculating a first difference between a preset extroversion value of the target first personality and an extroversion value of the target object.

[0069] For the embodiment of the present application, the electronic device subtracts the extroversion value of the target object from the preset extroversion value of the target first personality to obtain a first difference, and then takes the absolute value of the first difference. The absolute value represents the gap between the preset extroversion value of the target first personality and the extroversion value of the target object. The smaller the absolute value, the smaller the gap, and the greater the possibility that the target first personality belongs to the preferred personality.

[0070] Sb, determines a first possibility that the target's first personality belongs to the preferred personality based on the number of occurrences of the target's first personality, the correlation between the target's first personality and the second personality, the first difference, and their respective corresponding coefficients.

[0071] In summary, regarding the embodiments of this application, the number of occurrences of the target's first personality, the correlation between the target's first personality and the second personality, and the first difference are all key factors influencing the likelihood of the target's first personality being the preferred personality, and their influence varies. Relevant personnel can weight the number of occurrences of the target's first personality, the correlation between the target's first personality and the second personality, and the first difference to determine a score representing the first likelihood of the target's first personality being the preferred personality. A first likelihood determined by combining these three factors, including the number of occurrences of the target's first personality, is more accurate.

[0072] Sc, calculating a second difference between the preset extroversion value of the candidate personality and the extroversion value of the target object.

[0073] For the embodiment of the present application, determining the second difference may be performed in the manner described in step Sa, which will not be repeated here.

[0074] Sd, determines the second probability that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the correlation between the alternative personality and the second personality, the second difference, and their respective corresponding coefficients.

[0075] For the embodiment of the present application, determining the second possibility can be performed in the manner described in step Sb, which will not be repeated here.

[0076] In a possible implementation of the embodiment of the present application, step S10110 determines the preferred personality from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality, specifically including step S1 (not shown in the figure), step S2 (not shown in the figure), step S3 (not shown in the figure), step S4 (not shown in the figure), and step S5 (not shown in the figure), wherein: S1, determining a third difference between the extroversion value of the second personality and the extroversion value of the target object.

[0077] In this embodiment of the present application, the second personality also has an extroversion value associated with it. Each personality's corresponding extroversion value is set by a user and stored in a local storage medium within the electronic device. The electronic device subtracts the target person's extroversion value from the second personality's extroversion value to obtain a third difference, and then takes the absolute value of the third difference. The third difference represents the difference between the second personality's extroversion value and the target person's extroversion value. A smaller absolute value indicates a smaller difference, and a greater likelihood that the second personality is a preferred personality.

[0078] S2, determining a difference between the third difference and the first difference to obtain a fourth difference with respect to the first difference.

[0079] For the embodiment of the present application, the electronic device subtracts the absolute value of the first difference from the absolute value of the third difference to obtain a difference, which is the fourth difference. The smaller the fourth difference is, the closer the target first personality is to the second personality, and the more consistent it is with the extroversion value of the target object.

[0080] S3, determining a difference between the third difference and the second difference to obtain a fifth difference with respect to the second difference.

[0081] In the embodiment of the present application, the electronic device determines the degree of similarity between the candidate personality and the second personality in terms of extroversion value, that is, the fifth difference value, according to the solution recorded in step S2.

[0082] S4, correcting the first possibility based on the fourth difference to obtain a corrected first possibility, and correcting the second possibility based on the fifth difference to obtain a corrected second possibility.

[0083] In the embodiment of the present application, the electronic device determines a correction value for the first possibility based on the fourth difference, and then adds the correction value to the first possibility value to obtain the corrected first possibility. The electronic device obtains the corrected second possibility in the same manner. Specifically, the electronic device may pre-store a function that calculates the correction value based on the fourth difference or the fifth difference, which is set and stored by relevant personnel. Substituting the fourth difference and the fifth difference into the function, respectively, can obtain the corrected value for the first possibility and the corrected value for the second possibility.

[0084] S5, determining the personality corresponding to the maximum value between the corrected first possibility and the corrected second possibility as the preferred personality.

[0085] In this embodiment of the present application, the electronic device compares the corrected first possibility with the corrected second possibility to determine the maximum of the two. The personality corresponding to the maximum value is the target subject's preferred personality. By correcting the first and second possibilities based on the difference in extroversion between the target first personality and the alternative personality and the second personality, the determined preferred personality is more accurate.

[0086] In a possible implementation of the embodiment of the present application, determining the preferred emotion of the target object based on the first emotion and the second emotion in step S103 specifically includes step S1031 (not shown in the figure), step S1032 (not shown in the figure), step S1033 (not shown in the figure), step S1034 (not shown in the figure), step S1035 (not shown in the figure), step S1036 (not shown in the figure), step S1037 (not shown in the figure), step S1038 (not shown in the figure), and step S1039 (not shown in the figure), wherein: S1031, determining a first target chat record in which the first emotion and the second emotion are consistent, and determining a second target chat record in which the first emotion and the second emotion are inconsistent.

[0087] In the embodiment of the present application, the second emotion of the interlocutor may be consistent with or inconsistent with the first emotion of the target object during communication, so the electronic device determines a first target chat record with consistent emotions and a second target chat record with inconsistent emotions.

[0088] S1032: Determine a first proportion of the number of occurrences of each first emotion in all first emotions of the target object, and determine the target first emotion with the highest first proportion.

[0089] For the embodiment of the present application, the electronic device counts the number of times each first emotion appears in all first emotions, and calculates the first proportion of the number of times each first emotion appears to the total number of times all emotions appear, and determines the target first emotion with the highest first proportion. The target first emotion with the highest first proportion indicates that the target object is more likely to tend to this emotion in daily life or on its own.

[0090] S1033, if the first proportion of the target first emotion does not reach the preset proportion threshold, and there is a candidate first emotion whose difference with the first proportion of the target first emotion is less than the preset difference threshold, then determine the first number belonging to the target first emotion from the first target chat record, and determine the second number belonging to the target first emotion from the second target chat record.

[0091] In the embodiment of the present application, a preset ratio threshold serves as a demarcation point for determining whether the first ratio is high. The electronic device compares the first ratio of the target first emotion with the preset ratio threshold. If the preset ratio is not reached, it indicates that the target first emotion is likely to be a normal emotion in the target subject's daily life or personal life. Other emotions may also be part of the target subject's daily life or personal life. Therefore, the electronic device calculates the difference between the first ratios of the other first emotions and the target first ratio, thereby determining a candidate first emotion whose difference is less than the preset difference threshold. The candidate first emotion's first ratio is close to the first ratio of the target first emotion and may also be part of the target subject's daily life or personal life. The electronic device determines a first number of target first emotions from the first target chat record and a second number of target first emotions from the second target chat record. A higher first number indicates a greater proportion of the target subject experiencing the target first emotion in daily communication with multiple interlocutors, and a higher probability that the target first emotion is part of the target subject's daily life or personal life. A higher second number indicates that the target subject can still experience the target first emotion when communicating with interlocutors with different emotions, and a higher probability that the target first emotion is part of the target subject's daily life or personal life.

[0092] If the first proportion of the target first emotion reaches a preset proportion threshold, the target first emotion may be directly determined as the preferred emotion of the target object.

[0093] S1034, determining a second ratio of the first number to the total number of first target chat records, and determining a third ratio of the second number to the total number of second target chat records.

[0094] In this embodiment of the present application, the electronic device divides the first number by the total number of first-target chat records to obtain a second percentage. A larger second percentage indicates a greater proportion of the target subject being in the target first emotion during daily communications with multiple interlocutors, and a greater likelihood that the target first emotion belongs to the target subject's daily or personal emotions. A third percentage is obtained by dividing the second number by the total number of second-target chat records. A larger third percentage indicates that the target subject can still be in the target first emotion when communicating with interlocutors with different emotions, and a greater likelihood that the target first emotion belongs to the target subject's daily or personal emotions.

[0095] S1035 , correcting the first proportion of the target first emotion based on the second proportion and the third proportion to obtain a corrected first proportion of the target first emotion.

[0096] In the embodiments of the present application, in summary, the second and third proportions are both key factors that influence whether the target first emotion belongs to the target subject's daily or personal emotions. Therefore, the first proportion of the target first emotion is corrected based on the second and third proportions to obtain a corrected first proportion. Specifically, the relevant personnel can set corresponding weights for the second and third proportions. Since the third proportion is the proportion of the target first emotion when the first and second emotions are different, that is, the proportion of the target subject maintaining the target first emotion when different interlocutors are in different emotions, the larger the third proportion, the greater the likelihood that the target first emotion belongs to the target subject's daily or personal emotions. Therefore, the third proportion has a greater weight than the second proportion. The electronic device uses the corresponding weights to perform a weighted calculation on the second and third proportions to obtain a corrected score. The first proportion of the target first emotion is then corrected based on the corrected score to obtain a corrected first proportion. Specifically, the electronic device determines a corrected value for calculating the first proportion based on the corrected score. The electronic device may pre-store a function for calculating the corrected value, which is set by the relevant personnel. The electronic device then substitutes the corrected score into the function to calculate the corrected value. The corrected value is then added to the first proportion of the target first emotion to obtain the corrected first proportion.

[0097] S1036, determining a third number of first emotions to be selected from the first target chat record, and determining a fourth number of first emotions to be selected from the second target chat record.

[0098] For the embodiment of the present application, the electronic device can determine the third quantity and the fourth quantity according to the method recorded in step S1033, which will not be repeated here.

[0099] S1037, determining a fourth ratio of the third number to the total number of first target chat records, and determining a fifth ratio of the fourth number to the total number of second target chat records.

[0100] In the embodiment of the present application, the electronic device may determine the fourth proportion and the fifth proportion in the manner described in step S1034, which will not be described in detail here.

[0101] S1038: Correct the first proportion of the first emotion to be selected based on the fourth proportion and the fifth proportion to obtain a corrected first proportion of the first emotion to be selected.

[0102] In the embodiment of the present application, the electronic device may determine the first corrected proportion of the to-be-selected first emotion in the manner described in step S1036, which will not be described in detail here.

[0103] S1039: Determine the first emotion corresponding to the maximum value between the first proportion after correction of the target first emotion and the first proportion after correction of the candidate first emotion as the preferred emotion.

[0104] In the embodiment of the present application, the electronic device compares the first percentage after correction of the target first emotion and the first percentage after correction of the candidate first emotion to determine the maximum value between the two. The first emotion corresponding to the maximum value is the target subject's preferred emotion. By determining the target first emotion and the candidate first emotion and correcting the target first emotion and the candidate first emotion based on the second percentage, the third percentage, etc., the preferred emotion obtained is more accurate and consistent with the target subject's own situation.

[0105] In a possible implementation of the embodiment of the present application, in step S104, the personality characteristic value of the target object is determined based on the preferred emotion and the preferred personality, and the personality profile of the target object is determined based on the personality characteristic value. Specifically, the steps include step S1041 (not shown in the figure), step S1042 (not shown in the figure), step S1043 (not shown in the figure), step S1044 (not shown in the figure), and step S1045 (not shown in the figure), wherein: S1041, obtaining the possibility that the target object belongs to the preferred personality, and the first proportion after correction of the preferred emotion.

[0106] In this embodiment of the present application, after step S5, the electronic device may store the likelihood of the preferred personality for easy subsequent retrieval. Similarly, the corrected first percentage of the preferred emotion in step S1039 may be stored for easy subsequent retrieval.

[0107] S1042, determining a second ratio of the probability to the first proportion corrected with respect to the preference emotion.

[0108] The second ratio represents the character trait value of the target object regarding its personality.

[0109] In this embodiment of the present application, the electronic device divides the likelihood of the preferred personality by the first ratio after correction of the preferred emotion to obtain a second ratio. This second ratio is the personality characteristic value of the target object. The second ratio is more specific and, as a unique identifier of the target object's personality, is more accurate and more relevant to the target object's situation.

[0110] S1043, searching a preset database for a plurality of candidate personality description texts that satisfy the preferred emotions and preferred personalities.

[0111] The preset database includes a plurality of preset personality description texts, each of which corresponds to personality, emotion, and personality characteristic values ​​related to personality and emotion.

[0112] In the embodiment of the present application, the electronic device matches the preset database according to the target object's preferred personality and preferred character, thereby screening out multiple candidate personality description texts that are consistent with the target object's preferred emotions and preferred character. The multiple candidate personality description texts correspond to different personality feature values.

[0113] S1044: determining a screening interval for the personality characteristic value based on the personality characteristic value and a preset interval range, and screening out a target personality description text that falls within the screening interval from the personality characteristic values ​​of a plurality of candidate personality description texts.

[0114] In this embodiment of the present application, a preset range is set by a relevant person and stored in the electronic device. The electronic device uses the personality trait value to subtract the left boundary of the preset range and add the right boundary to obtain a screening range for the personality trait value. The electronic device then filters multiple candidate personality description texts based on the screening range to obtain a target personality description text that matches the screening range.

[0115] S1045, fusing all target personality description texts to obtain a personality portrait of the target object.

[0116] For the embodiment of the present application, each personality description text includes multiple descriptive sentences. The electronic device fuses all the target personality description texts to obtain a personality portrait of the target object. The personality portrait includes the same descriptive sentences and different descriptive sentences in the target personality description text. Therefore, the personality characteristic value is determined according to the preferred emotions and preferred personality of the target object, and then the matching personality description texts are screened out according to the personality characteristic value. The personality portrait obtained by fusing all the matching target personality description texts is more suitable for the target object, that is, the target portrait is more accurate and the combination of preferred emotions makes the description of the personality portrait more full and detailed.

[0117] The above embodiment introduces a method for analyzing a person's personality from the perspective of a method flow. The following embodiment introduces a device 20 for analyzing a person's personality from the perspective of a virtual module or a virtual unit. Please refer to the following embodiment for details.

[0118] The embodiment of the present application provides a character analysis device 20, such as Figure 2 As shown, a character analysis device 20 may specifically include: The personality determination module 201 is used to obtain chat records corresponding to the target object and multiple interlocutors, and determine the target object's preferred personality based on all chat records; Tone recognition module 202, for performing tone recognition on the sentences of the target object and the interlocutor in each chat record, respectively, to obtain the first emotion of the target object and the second emotion of the interlocutor corresponding to each chat record; An emotion determination module 203 is configured to determine the target object's preferred emotion based on the first emotion and the second emotion; The personality profile determination module 204 is configured to determine personality characteristic values ​​of the target object based on the preferred emotions and preferred personality, and to determine a personality profile of the target object based on the personality characteristic values.

[0119] The embodiment of the present application discloses a character analysis device 20, wherein a character determination module 201 obtains chat records between a target object and multiple interlocutors to obtain a large amount of communication texts, and the target object's preferred character can be accurately analyzed subsequently based on the large amount of communication texts. The tone recognition module 202 performs tone recognition on the corresponding sentences of the target object and the interlocutor in each chat record to obtain a first emotion about the target object and a second emotion of the interlocutor. The second emotion of the interlocutor may affect the target object's preferred emotion. Therefore, the emotion determination module 203 can determine the target object's preferred emotion based on the first emotion and the second emotion of each chat record. There is an influence relationship between the character's preferred emotion and preferred character. Therefore, the target object's character can be made fuller and the character portrait more accurate and detailed based on the preferred emotion. Therefore, the character portrait determination module 204 determines the character feature value of the target object based on the target object's preferred emotion and preferred character. The character portrait of the target object determined based on the character feature value is more specific, detailed and accurate.

[0120] In one possible implementation of the embodiment of the present application, when determining the preferred personality of the target object based on all chat records, the personality determination module 202 is specifically configured to: Determine the emoticons posted by the target object in each chat record, and perform word segmentation on the target object's sentences in each chat record to obtain a word set related to each chat record; Filtering the number of words in the preset vocabulary for each personality from the word set, and determining the first personality of the target object with respect to each chat record based on the number of words; Determine a preset number of target emoticon packages that are used most frequently by the target object from the emoticon packages in all chat records; Determine the preset emoji package library that each target emoji package hits, and determine the preset personality corresponding to the target preset emoji package library, and determine the preset personality as the second personality. The target preset emoji package library is the preset emoji package library that hits the most target emoji packages, and each preset emoji package library corresponds to one personality. Determine the target first personality whose first personality appears most frequently from all chat records; If the target's first personality is consistent with the second personality, the preferred personality is determined to be the target's first personality; If the target's first and second personalities are inconsistent, determine the correlation between the target's first and second personalities. From all chat records, determine the alternative personality whose first personality appears the second most frequently after the target's first personality. Then determine the correlation between the alternative personality and the second personality. The correlation represents the degree of similarity between each personality and other personalities. Determine the extroversion value of the target object based on the target object's statements and the interlocutor's statements in each chat record; Determine a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding relevance, and the extroversion value; and determine a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding relevance, and the extroversion value; A preferred personality is determined from the target first personality and the alternative personalities based on the first possibility, the second possibility, and the second personality.

[0121] In one possible implementation of the embodiment of the present application, when the personality determination module 202 determines the extroversion value of the target object based on the target object's statements and the interlocutor's statements in each chat record, it is specifically used for any of the following: Input each chat record into the trained network model to calculate the extroversion degree, obtain the sub-extroversion degree value of each chat record, and average the sub-extroversion degree values ​​of all chat records to obtain the extroversion degree value of the target object; or, Determine the proportion of questions in the messages sent by the target object in each chat record, and determine the average number of words in the target object's answers based on the number of words in each answer sentence. Determine a first ratio of the total number of messages from the interlocutors to the total number of messages from the target object in each chat record. Determine the sub-extroversion value of the target object for each chat record based on the proportion of questions, the average number of words in the answers, and the first ratio. Average the sub-extroversion values ​​of all chat records to obtain the extroversion value of the target object.

[0122] In one possible implementation of the embodiment of the present application, each personality has a preset extroversion value. The personality determination module 202 determines a first possibility that the target first personality is a preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value, and determines a second possibility that the alternative personality is a preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value, specifically for: calculating a first difference between a predetermined extroversion value of the target first personality and the extroversion value of the target object; Determine the first possibility that the target's first personality belongs to the preferred personality based on the number of occurrences of the target's first personality, the correlation between the target's first personality and the second personality, the first difference, and the corresponding coefficients; calculating a second difference between the preset extroversion value of the candidate personality and the extroversion value of the target subject; The second possibility that the alternative personality belongs to the preferred personality is determined based on the number of occurrences of the alternative personality, the correlation between the alternative personality and the second personality, the second difference, and the respective corresponding coefficients.

[0123] In one possible implementation of the embodiment of the present application, when the personality determination module 202 determines the preferred personality from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality, it is specifically configured to: determining a third difference between the extraversion value of the second personality and the extraversion value of the target object; determining a difference between the third difference and the first difference to obtain a fourth difference with respect to the first difference; determining a difference between the third difference and the second difference to obtain a fifth difference with respect to the second difference; Correcting the first possibility based on the fourth difference to obtain a corrected first possibility, and correcting the second possibility based on the fifth difference to obtain a corrected second possibility; The personality corresponding to the maximum value between the corrected first possibility and the corrected second possibility is determined as the preferred personality.

[0124] In a possible implementation of the embodiment of the present application, when the emotion determination module 203 determines the preferred emotion of the target object based on the first emotion and the second emotion, it is specifically configured to: Determine a first target chat record in which the first emotion and the second emotion are consistent, and determine a second target chat record in which the first emotion and the second emotion are inconsistent; Determine the first proportion of the number of occurrences of each first emotion in all first emotions of the target object, and determine the target first emotion with the highest first proportion; If the first proportion of the target first emotion does not reach the preset proportion threshold, and there is a candidate first emotion whose difference with the first proportion of the target first emotion is less than the preset difference threshold, then determine a first number belonging to the target first emotion from the first target chat record, and determine a second number belonging to the target first emotion from the second target chat record; Determine a second ratio of the first number to the total number of first target chat records, and determine a third ratio of the second number to the total number of second target chat records; Correcting the first proportion of the target first emotion based on the second proportion and the third proportion to obtain a corrected first proportion of the target first emotion; Determine a third number of first emotions to be selected from the first target chat record, and determine a fourth number of first emotions to be selected from the second target chat record; Determine a fourth ratio of the third number to the total number of first target chat records, and determine a fifth ratio of the fourth number to the total number of second target chat records; Correcting the first proportion of the first emotion to be selected based on the fourth proportion and the fifth proportion to obtain a corrected first proportion of the first emotion to be selected; The first emotion corresponding to the maximum value between the first proportion after correction of the target first emotion and the first proportion after correction of the candidate first emotion is determined as the preferred emotion.

[0125] In one possible implementation of the embodiment of the present application, the personality profile determination module 204 is specifically configured to: Obtain the probability that the target object belongs to the preferred personality, as well as the first proportion after correction of the preferred emotion; determining a second ratio of the probability to the first proportion corrected with respect to the preference emotion, the second ratio representing a personality trait value of the target object with respect to the personality; Searching a plurality of candidate personality description texts that satisfy the preferred emotions and preferred personalities from a preset database, wherein the preset database includes a plurality of preset personality description texts, each of which corresponds to a personality, an emotion, and personality characteristic values ​​related to the personality and the emotion; Determining a screening interval for the personality characteristic value based on the personality characteristic value and a preset interval range, and screening a target personality description text that falls within the screening interval from the personality characteristic values ​​of a plurality of candidate personality description texts; All target personality description texts are fused to obtain the personality portrait of the target object.

[0126] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the above-described character analysis device 20 can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0127] An electronic device is provided in an embodiment of the present application, such as Figure 3 As shown, Figure 3 The electronic device 30 shown includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 30 may further include a transceiver 304. It should be noted that in actual applications, the number of transceivers 304 is not limited to one, and the structure of the electronic device 30 does not constitute a limitation on the embodiments of the present application.

[0128] Processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0129] Bus 302 may include a path for transmitting information between the above components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 3 Only one thick line is used in the diagram, but it does not mean that there is only one bus or one type of bus.

[0130] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0131] The memory 303 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method embodiment.

[0132] Electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. They may also include servers, etc. Figure 3 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0133] The embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed on a computer, the computer can execute the corresponding content of the aforementioned method embodiment. Compared with the related art, the embodiment of the present application obtains chat records between a target object and multiple interlocutors to obtain a large amount of communication texts. Based on the large amount of communication texts, it is convenient to subsequently accurately analyze the target object's preferred personality. By performing tone recognition on the sentences corresponding to the target object and the interlocutor in each chat record, a first emotion of the target object and a second emotion of the interlocutor are obtained. The second emotion of the interlocutor may affect the preferred emotion of the target object. Therefore, the preferred emotion of the target object can be determined based on the first emotion and the second emotion of each chat record. There is an influence relationship between the preferred emotion and the preferred personality of the character. Therefore, the preferred emotion can make the character of the target object more full-bodied and the character portrait more accurate and detailed. Therefore, the character feature value of the target object is determined based on the preferred emotion and preferred personality of the target object. The character portrait of the target object determined based on the character feature value is more specific, detailed and accurate.

[0134] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0135] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for analyzing a person's personality, characterized in that: include: Obtaining chat records corresponding to the target object and multiple interlocutors, and determining the target object's preferred personality based on all chat records; Perform tone recognition on the target object and the interlocutor's sentences in each chat record, and obtain the target object's first emotion and the interlocutor's second emotion corresponding to each chat record; determining the target object's preferred emotion based on the first emotion and the second emotion; The personality characteristic value of the target object is determined based on the preferred emotion and the preferred personality, and the personality portrait of the target object is determined based on the personality characteristic value.

2. A character analysis method according to claim 1, characterized in that: The determining the target object's preferred personality based on all chat records includes: Determining the emoticons posted by the target object in each chat record, and performing word segmentation processing on the sentences of the target object in each chat record to obtain a word set related to each chat record; Filtering the number of words in a preset vocabulary for each personality from the word set, and determining the first personality of the target object with respect to each chat record based on the number of words; Determine a preset number of target emoticon packages that are used the most times by the target object from the emoticon packages in all chat records; Determine a preset emoji package library that each target emoji package hits, and determine a preset personality corresponding to the target preset emoji package library, and determine the preset personality as a second personality, wherein the target preset emoji package library is the preset emoji package library that hits the most target emoji packages, and each preset emoji package library corresponds to a personality; Determine the target first personality whose first personality appears most frequently from all chat records; If the target first personality is consistent with the second personality, determining the preferred personality as the target first personality; If the target first personality is inconsistent with the second personality, determining the correlation between the target first personality and the second personality, determining from all chat records an alternative personality whose first personality appears second only to the target first personality, and determining the correlation between the alternative personality and the second personality, wherein the correlation represents the degree of similarity between each personality and the other personality; Determine the extroversion degree value of the target object based on the statements of the target object and the statements of the interlocutor in each chat record; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value; and determining a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value; The preferred personality is determined from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality.

3. A character analysis method according to claim 2, characterized in that: The determining of the extroversion value of the target object based on the statements of the target object and the statements of the interlocutor in each chat record includes any one of the following: Input each chat record into the trained network model to calculate the extroversion degree, obtain the sub-extroversion degree value of each chat record, and average the sub-extroversion degree values ​​of all chat records to obtain the extroversion degree value of the target object; or, Determine the proportion of questions in the messages sent by the target object in each chat record, and determine the average number of words in the target object's answers based on the number of words in each answer sentence. Determine a first ratio of the total number of messages from the interlocutors to the total number of messages from the target object in each chat record. Determine the sub-extroversion value of the target object for each chat record based on the proportion of questions, the average number of words in the answers, and the first ratio. Average the sub-extroversion values ​​of all chat records to obtain the extroversion value of the target object.

4. A character analysis method according to claim 2, characterized in that: Each personality has a preset extroversion value corresponding to it. Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the corresponding correlation degree of the target first personality, and the extroversion value, and determining a second possibility that the alternative personality belongs to the preferred personality based on the number of occurrences of the alternative personality, the corresponding correlation degree of the alternative personality, and the extroversion value, includes: Calculating a first difference between a preset extroversion value of the target first personality and the extroversion value of the target object; Determining a first possibility that the target first personality belongs to the preferred personality based on the number of occurrences of the target first personality, the correlation between the target first personality and the second personality, the first difference, and the respective corresponding coefficients; Calculating a second difference between the preset extroversion value of the candidate personality and the extroversion value of the target object; A second possibility that the alternative personality belongs to the preferred personality is determined based on the number of occurrences of the alternative personality, the correlation between the alternative personality and the second personality, the second difference, and the respective corresponding coefficients.

5. A character analysis method according to claim 2, characterized in that: Determining the preferred personality from the target first personality and the candidate personalities based on the first possibility, the second possibility, and the second personality includes: determining a third difference between the extroversion value of the second personality and the extroversion value of the target object; Determine a difference between the third difference and the first difference to obtain a fourth difference with respect to the first difference; determining a difference between the third difference and the second difference to obtain a fifth difference with respect to the second difference; Correcting the first possibility based on the fourth difference to obtain a corrected first possibility, and correcting the second possibility based on the fifth difference to obtain a corrected second possibility; The personality corresponding to the maximum value between the modified first possibility and the modified second possibility is determined as the preferred personality.

6. A character analysis method according to claim 1, characterized in that: Determining the target object's preferred emotion based on the first emotion and the second emotion includes: Determine a first target chat record in which the first emotion and the second emotion are consistent, and determine a second target chat record in which the first emotion and the second emotion are inconsistent; Determining a first proportion of the number of occurrences of each first emotion in all first emotions of the target object, and determining the target first emotion with the highest first proportion; If the first proportion of the target first emotion does not reach the preset proportion threshold, and there is a candidate first emotion whose difference with the first proportion of the target first emotion is less than the preset difference threshold, then determining a first number belonging to the target first emotion from the first target chat record, and determining a second number belonging to the target first emotion from the second target chat record; Determine a second ratio of the first number to the total number of first target chat records, and determine a third ratio of the second number to the total number of second target chat records; Correcting the first proportion of the target first emotion based on the second proportion and the third proportion to obtain a corrected first proportion of the target first emotion; Determine a third number of first emotions to be selected from the first target chat record, and determine a fourth number of first emotions to be selected from the second target chat record; Determine a fourth ratio of the third number to the total number of first target chat records, and determine a fifth ratio of the fourth number to the total number of second target chat records; Correcting the first proportion of the first emotion to be selected based on the fourth proportion and the fifth proportion to obtain a corrected first proportion of the first emotion to be selected; The first emotion corresponding to the maximum value between the first proportion after correction of the target first emotion and the first proportion after correction of the candidate first emotion is determined as the preferred emotion.

7. A character analysis method according to claim 6, characterized in that: Determining the personality characteristic value of the target object based on the preferred emotion and the preferred personality, and determining the personality profile of the target object based on the personality characteristic value, including: Obtaining the possibility that the target object belongs to the preferred personality and the first proportion after correction of the preferred emotion; Determining a second ratio of the likelihood to the first corrected ratio of the preferred emotion, the second ratio representing a personality trait value of the target object with respect to personality; Searching a plurality of candidate personality description texts that satisfy the preferred emotions and preferred personalities from a preset database, wherein the preset database includes a plurality of preset personality description texts, each of which corresponds to a personality, an emotion, and personality characteristic values ​​related to the personality and the emotion; Determining a screening interval for the personality characteristic value based on the personality characteristic value and a preset interval range, and screening a target personality description text that falls within the screening interval from the personality characteristic values ​​of the plurality of candidate personality description texts; All target personality description texts are fused to obtain the personality portrait of the target object.

8. A device for analyzing a person's personality, characterized in that: include: A personality determination module is used to obtain chat records corresponding to the target object and multiple interlocutors, and determine the preferred personality of the target object based on all chat records; A tone recognition module is used to perform tone recognition on the sentences of the target object and the interlocutor in each chat record, and obtain the first emotion of the target object and the second emotion of the interlocutor corresponding to each chat record; An emotion determination module, configured to determine the target object's preferred emotion based on the first emotion and the second emotion; The personality portrait determination module is used to determine the personality characteristic value of the target object based on the preferred emotion and preferred personality, and to determine the personality portrait of the target object based on the personality characteristic value.

9. An electronic device, characterized in that: It includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, and the at least one application is used to execute the character analysis method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the character analysis method according to any one of claims 1 to 7.