Disclosure of Invention
The embodiment of the application provides a personality testing method and device based on man-machine conversation and electronic equipment, and can solve the problems of boring and low accuracy in the personality testing process.
In a first aspect, an embodiment of the present application provides a personality testing method based on human-computer conversation, where the method includes:
obtaining dialogue data of a target user;
extracting target dialog features from the dialog data, the target dialog features characterizing personality characteristics of the target user;
and determining the personality attribute corresponding to the target dialogue characteristic according to a preset personality attribute standard to serve as the personality test result of the target user.
In an optional design, determining a personality attribute corresponding to the target dialog feature according to a preset personality attribute standard includes:
and inputting the target dialogue features into a pre-trained test model to obtain character attributes corresponding to the target dialogue features.
In an alternative design, the pre-trained test model is trained by:
obtaining training sample data and a scale test result corresponding to each group of data in the training sample data, and taking all scale test results as the preset character attribute standard;
acquiring a conversation feature set from the training sample data to serve as a training sample feature set;
selecting a target training rule from a plurality of pre-deployed training rules according to the training sample feature set;
and training a test network to be trained by using the training sample feature set, the preset character attribute standard and the target training rule to obtain the pre-trained test model.
In an alternative design, any of the dialog features in the dialog feature set includes at least one of:
topic keywords, tone word habit characteristics, punctuation mark habit characteristics, field length of unit text, conversation time interval and habit change characteristics.
In an alternative design, the selecting a target training rule from a plurality of pre-deployed training rules according to the training sample feature set includes:
respectively operating the training sample feature sets according to the plurality of pre-deployed training rules to respectively obtain a training result;
and taking the training rule with the training result closest to the preset value as the target training rule.
In an alternative design, the plurality of pre-deployed training rules include at least two of the following rules:
logistic regression, K-nearest neighbor KNN, random forest and decision tree.
In an optional design, after determining a personality attribute corresponding to the target dialog feature according to a preset personality attribute standard as a personality test result of the target user, the method further includes:
obtaining the test feedback of the target user;
and optimizing the pre-trained test model according to the test feedback.
In a second aspect, an embodiment of the present application provides a personality testing device based on human-computer conversation, where the device includes:
the acquisition module is used for acquiring the dialogue data of the target user;
an extraction module for extracting target dialogue features from the dialogue data, wherein the target dialogue features represent character features of the target user;
and the processing module is used for determining the personality attribute corresponding to the target conversation characteristic according to a preset personality attribute standard and outputting the personality attribute as a personality test result of the target user.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and one or more processors; wherein the memory is to store computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform some or all of the steps of the human-machine dialog based personality testing method of the first aspect or various possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer storage medium, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to perform part or all of the steps of the human-computer dialogue based personality testing method in the first aspect or various possible implementations of the first aspect.
The embodiment of the application provides a personality testing method based on man-machine conversation, which comprises the following steps: acquiring dialogue data of a target user; extracting target dialog features from the dialog data, the target dialog features characterizing personality characteristics of the target user; and determining the personality attribute corresponding to the target dialogue characteristic according to a preset personality attribute standard, and outputting the personality attribute as a personality test result of the target user. The target user and the equipment are used for testing in a dialogue mode, the interestingness of the test is improved, the preset personality attribute standard is combined with the psychology related scale and the language characteristics, professional psychology theory support is achieved, and the accuracy of the test result is improved.
Detailed Description
The following describes technical solutions of embodiments of the present application with reference to the drawings in the embodiments of the present application.
The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that although the terms first, second, etc. may be used in the following embodiments to describe a class of objects, the objects should not be limited to these terms. These terms are only used to distinguish between particular objects of that class of objects.
The embodiment of the application provides a personality testing method based on man-machine conversation and electronic equipment.
The personality testing method based on man-machine conversation related to the embodiment of the application is described below through several implementation modes.
As shown in fig. 1, fig. 1 illustrates a personality testing method 100 (hereinafter referred to as method 100) based on man-machine conversation, where the method 100 includes the following steps:
step S101, session data of the target user is acquired.
Step S102, extracting target dialogue characteristics from the dialogue data, wherein the target dialogue characteristics represent the character characteristics of the target user.
And step S103, determining the personality attribute corresponding to the target dialogue characteristic according to a preset personality attribute standard, and outputting the personality attribute as the personality test result of the target user.
In this embodiment, the personality test is performed in a man-machine conversation mode, and the target user is required to have a conversation communication with the device, and the number of conversation turns is not less than forty turns so as to obtain enough conversation data to perform the personality test. And then extracting the dialogue features capable of representing the personality attributes of the target user from the dialogue data, such as: and determining corresponding personality attributes from preset personality attribute standards according to the conversation characteristics to obtain a test result, wherein the theme keywords of the target user in the conversation process, the tone words and punctuation mark using conditions of the target user, the input length of each pair of conversation target users, the reply time between different turns and the like.
In the embodiment, the personality test is performed in a man-machine conversation mode, so that the test process is not boring and interesting, in addition, the preset personality attribute standard is obtained by the user according to the professional psychology scale test, different personality characteristics correspond to different personality attributes, and the corresponding personality attributes can be found from the personality attribute standard, so that the test result is supported by the professional psychology theory, and the result is more accurate.
In an optional implementation manner, determining a personality attribute corresponding to the target dialog feature according to a preset personality attribute standard includes:
and inputting the target dialogue features into a pre-trained test model to obtain character attributes corresponding to the target dialogue features.
In an alternative embodiment, the pre-trained test model is obtained by training the following method:
obtaining training sample data and a scale test result corresponding to each group of data in the training sample data, and taking all scale test results as the preset character attribute standard;
acquiring a conversation feature set from the training sample data to serve as a training sample feature set;
selecting a target training rule from a plurality of pre-deployed training rules according to the training sample feature set;
and training a test network to be trained by using the training sample feature set, the preset character attribute standard and the target training rule to obtain the pre-trained test model.
In this embodiment, the correspondence from the dialogue data to the personality attributes is accomplished by building a pre-trained test model. The specific implementation manner is shown in fig. 2, and fig. 2 shows a flow chart of a training and testing method, which includes acquiring training sample data, recruiting a plurality of testees, randomly grouping the testees to have two-to-two conversations, and acquiring conversation data as the training sample data, although the training sample data may be acquired in other manners. And meanwhile, carrying out professional psychological scale test on the testee, taking the obtained scale test result as the character label of each testee, and summarizing all the character labels to obtain the preset character attribute standard. And then obtaining training sample feature sets of multiple dimensions from the training sample data, wherein the training sample feature sets mainly comprise some features for characterizing the character description of the user, such as: and then training by adopting various machine learning methods, carrying out cross-folding verification to determine an optimal target training rule, and training on the basis of the optimal target training rule to obtain a pre-trained test model. Because the personality label corresponding to each tested person is obtained, after the training sample feature set is obtained, the personality label of the tested person corresponding to a certain or some specific features can be determined from the preset personality attribute standard, and the purpose of determining the personality attribute according to the conversation feature is achieved.
In this embodiment, sufficient training sample data and a scale test result corresponding to each user are obtained to ensure that the obtained training sample feature set includes all human behavior characteristics, such as personality traits, temporary states, emotions, and the like, and the preset personality attribute standard can include all personality attributes of a human, so as to determine the corresponding user and the corresponding features. Therefore, the test model can comprehensively and standard test the dialogue data of the target user and output the character attribute.
In an alternative embodiment, any of the set of dialog features includes at least one of the following features:
topic keywords, tone word habit characteristics, punctuation mark habit characteristics, field length of unit text, conversation time interval and habit change characteristics.
In this embodiment, the training sample feature set and the target dialog features include, but are not limited to, those described above, and may also include other features capable of characterizing the personality attributes of the user. For example, extracting a key field capable of representing the subject content of the current conversation from training sample data, and representing a key word or a word of the current conversation topic, and using conditions of the tone word in the user conversation process, such as whether each sentence contains: and (5) voice words such as, calash, Domo, woolen, and the like, and carrying out statistics. It is also possible to extract the punctuation mark usage category and frequency of each sentence from the training sample data, for example, in a case where a large number of exclamation marks or question marks appear in a sentence, or in a case where each sentence is short and does not include punctuation marks. And the lengths of dialogs in different turns, the number of words and fields of each dialog sent, the reply time interval between different turns and the habit change condition of a user in the dialog process can be extracted. For example, the language habits of users in a certain group of data can always repeat to speak a certain word, the conversation time interval is long, and the corresponding users can be determined to be \33148oran longhui type personality according to the characteristics through comparison by the preset personality attribute standards. Through the characteristics, the personality attributes corresponding to different conversation characteristics of a person can be comprehensively analyzed, and further personality testing of the user is realized.
In an alternative embodiment, the selecting a target training rule from a plurality of pre-deployed training rules according to the training sample feature set includes:
respectively operating the training sample feature set according to the plurality of pre-deployed training rules to respectively obtain a training result;
and taking the training rule with the training result closest to the preset value as the target training rule.
In an alternative embodiment, the plurality of pre-deployed training rules include at least two of the following rules:
logistic regression, K-nearest neighbor KNN, random forest and decision tree.
In this embodiment, a plurality of training rules are evaluated in a cross-validation manner, so as to determine an optimal training rule, which greatly improves the efficiency of testing.
In an optional implementation manner, after determining, according to a preset personality attribute standard, a personality attribute corresponding to the target dialog feature, as a personality test result of the target user, the method further includes:
obtaining the test feedback of the target user;
and optimizing the pre-trained test model according to the test feedback.
In this embodiment, as shown in fig. 2, after the character test result is output to the user, the user can give feedback of the test result according to the situation of the user, the accurate place is continuously maintained, the place where the test result is inaccurate is modified, the test model is continuously optimized, and the accuracy of the test is increased.
In summary, the personality testing method based on the man-machine conversation increases the interestingness of the test by performing the personality test in a conversation mode, determines the personality attributes according to the personality attribute standard supported by the professional psychology theory, enables the test result to be professional and reliable, further optimizes the model according to feedback, and improves the accuracy of the test.
Corresponding to the method 100, an apparatus for performing the method is also provided in the embodiments of the present application.
As shown in fig. 3, fig. 3 illustrates apersonality testing device 300 based on human-computer conversation, which includes:
an obtainingmodule 301, configured to obtain session data of a target user.
An extractingmodule 302, configured to extract a target dialog feature from the dialog data, where the target dialog feature represents a personality feature of the target user.
And theprocessing module 303 is configured to determine a personality attribute corresponding to the target dialog feature according to a preset personality attribute standard, and output the personality attribute as a personality test result of the target user.
It should be understood that theapparatus 300 is also used for performing part or all of the steps of the corresponding method in fig. 1 and 2, and the specific implementation process is described with reference to the above-mentioned embodiment illustrated in fig. 1 and 2 and is not described in detail here.
It is understood that the above division of each module/unit is only a division of a logic function, and in actual implementation, the functions of the above modules may be integrated into a hardware entity, for example, the functions of the extraction module and the processing module may be integrated into a processor, the functions of the acquisition module may be integrated into a transceiver, and programs and instructions for implementing the functions of the above modules may be maintained in a memory. For example, fig. 4 provides anelectronic device 41, theelectronic device 41 including may include aprocessor 411, atransceiver 412, and amemory 413. Thetransceiver 412 is used for performing transceiving of data and signals in the method 100. Thememory 413 may be used to store programs/code or the like needed by theprocessor 411 to perform the method 100.
The specific implementation process is described with reference to the embodiments illustrated in fig. 1 and fig. 2, and is not described in detail here.
In specific implementation, corresponding to the foregoingelectronic device 41, an embodiment of the present application further provides a computer storage medium, where the computer storage medium provided in theelectronic device 41 may store a program, and when the program is executed, part or all of the steps in the embodiments of the method 100 may be implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
It can be understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a control device of a cloud game, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
While alternative embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-mentioned embodiments are only examples of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present application should be included in the scope of the present invention.