CN109960725B - Text classification processing method and device based on emotion and computer equipment - Google Patents

Text classification processing method and device based on emotion and computer equipment Download PDF

Info

Publication number
CN109960725B
CN109960725B CN201910042837.5A CN201910042837A CN109960725B CN 109960725 B CN109960725 B CN 109960725B CN 201910042837 A CN201910042837 A CN 201910042837A CN 109960725 B CN109960725 B CN 109960725B
Authority
CN
China
Prior art keywords
emotion
question
text
model
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910042837.5A
Other languages
Chinese (zh)
Other versions
CN109960725A (en
Inventor
金戈
徐亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910042837.5A priority Critical patent/CN109960725B/en
Publication of CN109960725A publication Critical patent/CN109960725A/en
Priority to PCT/CN2019/117161 priority patent/WO2020147395A1/en
Application granted granted Critical
Publication of CN109960725B publication Critical patent/CN109960725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application relates to a text classification processing method and device based on emotion and computer equipment. The method comprises the following steps: acquiring an emotion classification task, wherein the emotion classification task comprises a text identifier to be classified; acquiring a corresponding text to be classified according to the text to be classified identification, wherein the text to be classified comprises a plurality of questions and corresponding question replies; invoking a corresponding emotion classification model according to the emotion classification task, wherein the emotion classification model comprises a plurality of sub-models; inputting the questions and the corresponding answers to the questions to the corresponding submodels, and outputting emotion scores corresponding to the questions through submodel operation; and identifying the emotion type corresponding to the text to be classified according to emotion scores corresponding to the problems. By adopting the method, the accuracy of emotion classification of the text can be effectively improved.

Description

Text classification processing method and device based on emotion and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a text classification processing method and apparatus based on emotion, a computer device, and a storage medium.
Background
With the development of computer technology, computer technology is increasingly applied to emotion classification processing of text. For example, in AI (ARTIFICIAL INTELLIGENCE ) interviews, emotion attitudes of the interviewees are obtained by performing emotion classification processing on answers of the interviewees, so that enterprises can screen the interviewees according to requirements. For another example, in a questionnaire, the answers of the surveyor are subjected to emotion classification processing to understand the emotion tendencies of the surveyor.
In the conventional manner, emotion classification is generally performed on all collected texts in a unified manner. However, in many cases, the text content corresponds to different questions, and the degree of emotion reflected by the different questions may be different. The emotion classification is uniformly carried out on all text contents, so that emotion expression under different problems cannot be accurately reflected, and the situation that the emotion classification result is inaccurate is caused. Therefore, how to improve the accuracy of emotion classification is a technical problem to be solved at present.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a text classification processing method, apparatus, computer device, and storage medium based on emotion, which can improve emotion classification accuracy.
A text classification processing method based on emotion, the method comprising:
Acquiring an emotion classification task, wherein the emotion classification task comprises a text identifier to be classified;
acquiring a corresponding text to be classified according to the text to be classified identification, wherein the text to be classified comprises a plurality of questions and corresponding question replies;
Invoking a corresponding emotion classification model according to the emotion classification task, wherein the emotion classification model comprises a plurality of sub-models;
inputting the questions and the corresponding answers to the questions to the corresponding submodels, and outputting emotion scores corresponding to the questions through submodel operation;
And identifying the emotion type corresponding to the text to be classified according to emotion scores corresponding to the problems.
In one embodiment, the inputting the questions and the corresponding answers to the questions into the corresponding submodels, through submodel operation, includes:
word segmentation is carried out on the question answers to obtain a plurality of words;
Calling a corresponding sub-model according to the problem;
And carrying out emotion classification on the words by utilizing the sub-model to obtain emotion scores corresponding to the problems.
In one embodiment, after the emotion types corresponding to the text to be classified are identified according to emotion scores corresponding to a plurality of questions, the method further includes:
Acquiring emotion demand types;
matching the classified emotion type with the emotion demand type to obtain a corresponding first matching degree;
screening emotion types meeting preset conditions according to the first matching degree;
And extracting the main body information corresponding to the emotion type.
In one embodiment, after the emotion types corresponding to the text to be classified are identified according to emotion scores corresponding to a plurality of questions, the method further includes:
Acquiring a plurality of product information, wherein the product information comprises a product type;
Matching the product type with the classified emotion type to obtain a corresponding second matching degree;
When the second matching degree is larger than a preset value, marking the product information corresponding to the product type as target product information;
And extracting a terminal identifier corresponding to the emotion type, and pushing the target product information to a terminal corresponding to the terminal identifier.
In one embodiment, the identifying the emotion type corresponding to the text to be classified according to emotion scores corresponding to a plurality of questions includes:
acquiring the weight corresponding to each problem;
Calculating according to the weight and the corresponding emotion score to obtain a modified score;
Accumulating the modified scores corresponding to the problems to obtain an emotion total score;
And identifying the emotion type corresponding to the text to be classified according to the emotion total score.
An emotion-based text classification processing device, the device comprising:
the task acquisition module is used for acquiring an emotion classification task, wherein the emotion classification task comprises a text identifier to be classified;
The text acquisition module is used for acquiring corresponding text to be classified according to the text to be classified identification, wherein the text to be classified comprises a plurality of questions and corresponding question replies;
The model calling module is used for calling a corresponding emotion classification model according to the emotion classification task, and the emotion classification model comprises a plurality of sub-models; inputting the questions and the corresponding answers to the questions to the corresponding submodels, and outputting emotion scores corresponding to the questions through submodel operation;
And the emotion type identification module is used for identifying emotion types corresponding to the texts to be classified according to emotion scores corresponding to the problems.
In one embodiment, the model invoking module is further configured to word the question answer to obtain a plurality of words; calling a corresponding sub-model according to the problem; and carrying out emotion classification on the words by utilizing the sub-model to obtain emotion scores corresponding to the problems.
In one embodiment, after the emotion type identification module, the apparatus further includes:
the demand type acquisition module is used for acquiring emotion demand types;
the type matching module is used for matching the classified emotion type with the emotion demand type to obtain a corresponding first matching degree;
the emotion type screening module is used for screening emotion types meeting preset conditions according to the first matching degree;
And the information extraction module is used for extracting the main body information corresponding to the emotion type.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
According to the emotion-based text classification processing method, the emotion-based text classification processing device, the computer equipment and the storage medium, after the text identification to be classified in the emotion classification task is obtained, a plurality of questions corresponding to the text to be classified and question answers corresponding to each question are obtained according to the text identification to be classified, a plurality of sub-models in an emotion classification model are called, the question answers corresponding to each question are subjected to emotion classification one by one, and emotion types corresponding to the text to be classified are identified according to the emotion scores corresponding to each question. And carrying out emotion classification on the question answers one by one according to the specific situation of each question by calling the corresponding sub-model, and then integrating emotion scores corresponding to each question to identify emotion types corresponding to the text to be classified. Compared with the conventional method for uniformly carrying out emotion classification on all texts, the method has the advantages that questions are fully combined, emotion classification is carried out on corresponding question replies, and accuracy of emotion classification on the texts is effectively improved.
Drawings
FIG. 1 is an application environment diagram of an emotion-based text classification processing method in one embodiment;
FIG. 2 is a flow diagram of a text classification processing method based on emotion in one embodiment;
FIG. 3 is a flowchart illustrating a step of extracting subject information according to emotion types in one embodiment;
FIG. 4 is a block diagram of an emotion-based text classification processing device in one embodiment;
FIG. 5 is a block diagram of a text classification processing device based on emotion in another embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The text classification processing method based on emotion provided by the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 acquires an emotion classification task initiated by the terminal 102, the emotion classification task comprises text identifiers to be classified, the server 104 acquires corresponding texts to be classified according to the text identifiers to be classified, and a corresponding emotion classification model is called according to the acquired emotion classification task. The server 104 inputs the questions and the answers of the questions in the text to be classified into the submodels of the emotion classification model, and outputs emotion scores corresponding to the questions through submodel operation. Server 104 identifies emotion types corresponding to the text to be classified according to emotion scores corresponding to the plurality of questions. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, and tablet computers, and the server 104 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, there is provided a text classification processing method based on emotion, which is illustrated by taking the application of the method to the server 104 in fig. 1 as an example, and includes the following steps:
step 202, acquiring an emotion classification task, wherein the emotion classification task comprises a text identifier to be classified.
The server acquires the emotion classification task, analyzes the acquired emotion classification task, and obtains a text identifier to be classified included in the emotion classification task. The emotion classification task may be created by the terminal and uploaded to the server. The emotion classification task comprises text identifiers to be classified, and the text identifiers to be classified point to corresponding texts to be classified. The text labels to be classified may include a plurality of types. In one embodiment, the text to be classified identification may be a file name of the text to be classified. The server can execute emotion classification tasks, and emotion classification processing is carried out on the text to be classified corresponding to the text identification to be classified.
Step 204, obtaining a corresponding text to be classified according to the text to be classified identifier, wherein the text to be classified comprises a plurality of questions and corresponding question replies.
The server can acquire the corresponding text to be classified according to the text to be classified identification. Specifically, the server may obtain a mapping relationship between the text identifier to be classified and the text to be classified, and obtain the text to be classified corresponding to the text identifier to be classified by using the mapping relationship. The text to be classified comprises a plurality of questions and corresponding answers to the questions.
The server may present different questions for different users, or may present the same questions for different users. The question answer is an answer opinion made by the user for each question correspondence. For example, in an artificial intelligence interview process, different questions can be presented for different interviewees and answers of the interviewees are received as corresponding question answers, so as to avoid the interviewees from communicating privately and reflect the strain capacity of the interviewees more truly. The way in which the problem is posed may be varied. The server can randomly select questions from preset questions to ask questions, and can select related questions to ask questions according to answers of interviewees. For another example, during a questionnaire, the server may present the same questions to different respondents and receive the respondents' answers to the questions to learn the emotional tendency of the respondents to the questions.
Step 206, invoking a corresponding emotion classification model according to the emotion classification task, wherein the emotion classification model comprises a plurality of sub-models.
The server can call a corresponding emotion classification model according to the emotion classification task, wherein the emotion classification model is a model which is obtained through training and is used for performing emotion classification on the questions and the question reply texts. The emotion classification model can be trained by various classification models, such as Fasttext models. The emotion classification model comprises a plurality of sub-models, and different problems can correspond to different sub-models. The server can call a sub-model corresponding to the problem in the emotion classification model according to the emotion classification task to carry out emotion classification processing on the problem answer.
And step 208, inputting the questions and the corresponding answers to the questions into the corresponding submodels, and outputting emotion scores corresponding to the questions through submodel operation.
The server inputs the questions in the text to be classified and the corresponding question answers into the corresponding submodels, and invokes the submodels to perform emotion classification on the question answers. And outputting emotion scores corresponding to the problems through the operation of the submodels. Wherein the emotion score may reflect the emotional propensity of the question answer to the question. Specifically, the server performs operation by calling the submodel to obtain the probability of each emotion label corresponding to the question reply. And calculating according to the probability of the corresponding emotion label to obtain the emotion score corresponding to the problem, and outputting the emotion score corresponding to the problem. For example, the Fasttext model is used for emotion classification of the text to be classified. The server inputs the question replies in the text to be classified into the submodels of the Fasttext model corresponding to the questions, and the submodels carry out emotion classification processing on the question replies to obtain probabilities corresponding to a plurality of emotion labels. For example, the emotion tags may include positive and negative, the emotion classification result of the question answer being: the positive probability is 68% and the negative probability is 32%. And calculating emotion scores corresponding to the corresponding questions according to the emotion label probability of the questions, wherein the emotion scores are 7 when the emotion scores are 10 minutes.
And 210, identifying emotion types corresponding to the text to be classified according to emotion scores corresponding to the problems.
The server synthesizes emotion scores corresponding to the problems, identifies emotion types corresponding to the text to be classified according to the emotion scores corresponding to the problems, and completes emotion classification tasks for emotion classification of the text to be classified.
In this embodiment, after the text identifier to be classified in the emotion classification task is obtained, a plurality of questions corresponding to the text to be classified and question replies corresponding to each question are obtained according to the text identifier to be classified, a plurality of sub-models in the emotion classification model are called, the question replies corresponding to each question are subjected to emotion classification one by one, and emotion types corresponding to the text to be classified are identified according to the obtained emotion scores corresponding to each question. And carrying out emotion classification on the question answers one by one according to the specific situation of each question by calling the corresponding sub-model, and then integrating emotion scores corresponding to each question to identify emotion types corresponding to the text to be classified. Compared with the conventional method for uniformly carrying out emotion classification on all texts, the method has the advantages that questions are fully combined, emotion classification is carried out on corresponding question replies, and accuracy of emotion classification on the texts is effectively improved.
In one embodiment, the step of identifying emotion types corresponding to the text to be classified according to emotion scores corresponding to a plurality of questions includes: acquiring the weight corresponding to each problem; calculating according to the weight and the corresponding emotion score to obtain a modified score; accumulating the modified scores corresponding to the problems to obtain an emotion total score; and identifying the emotion type corresponding to the text to be classified according to the emotion total score.
The server obtains the weight corresponding to each problem. Because the importance of the classification degree of the text to be classified is different for each question, in order to balance the influence of each question on the emotion classification degree, each question is correspondingly provided with a weight. The user can preset the corresponding importance for each question, and the server sets the weight corresponding to each question according to the importance of each question in all questions. The important questions may be weighted higher and the simple questions may be weighted lower. And the server calculates according to the weight and the emotion score corresponding to each problem to obtain a modified score corresponding to each problem. The modified score can objectively reflect the emotion of the corresponding question answer in the text to be classified. For example, during interview, different types of questions may occur, such as questions about identity, personal skills, job intent, and the like. Of the three types of questions described above, questions about identity may be weighted less than questions about personal skills and job intent. Therefore, according to the emotion scores of the three types of questions, the weight corresponding to the questions needs to be combined, and calculation is performed again to obtain the modified scores corresponding to the questions.
And accumulating the modified scores corresponding to the calculated problems by the server to obtain the emotion total score. The emotion total score is the emotion total score of the text to be classified which integrates the problems. And the server identifies emotion types corresponding to the texts to be classified according to the emotion total score, and completes emotion classification tasks of text classification of the texts to be classified.
In this embodiment, the server calculates the modified score of each question by acquiring the weight corresponding to each question, accumulates the modified scores corresponding to a plurality of questions to obtain the emotion total score, and identifies the emotion type corresponding to the text to be classified by the emotion total score. By combining the weight corresponding to each problem, the influence of the importance of the problem on the final emotion type is solved, and the accuracy of emotion classification of the text to be classified is effectively improved.
In one embodiment, the reply opinion a user makes for a question may include a variety of forms. For example, text forms and voice forms may be included. The server may determine the form of the reply opinion upon receipt of the reply opinion. If the text is in the form of a text, the answer opinion in the form of the text is directly used as a question answer, and the text to be classified is generated by combining a plurality of questions and the question answer. If the reply opinion is a voice form content, the server converts the voice content into a text form reply content, and replies the reply content as a question to generate a text to be classified.
In this embodiment, in addition to receiving a question answer in text form, a question answer in speech form may also be received. The text to be classified is generated by converting the question answers in the voice form into the question answers in the text form, so that compatible question answer forms are enriched, and a user can conveniently adopt multiple forms to make the question answers.
In one embodiment, the steps of inputting the questions and corresponding answers to the questions to corresponding sub-models, and operating by the sub-models, include: word segmentation is carried out on the question answers to obtain a plurality of words; calling a corresponding sub-model according to the problem; and carrying out emotion classification on the words by using the sub-model to obtain emotion scores corresponding to the problems.
The server may segment the answers to questions in the text to be classified in a variety of ways to obtain a plurality of terms. Specifically, the server may segment the answer to the question by using one or more of matching strings, understanding, and counting. The character string matching mode is to match the question answer with the entry in the preset dictionary, and if the character string is found in the dictionary, the matching is considered successful, namely a word is identified. The manner of string matching may include forward string matching and reverse string matching. The understanding mode refers to semantic analysis and syntactic analysis when a server performs word segmentation on the question answers, and ambiguity occurs when the word segmentation is processed by using semantic information and syntactic information. The statistical method is that the server counts the frequency of the combination of the adjacent co-occurrence words in the question answer, and performs word segmentation according to the co-occurrence information of the words. In one embodiment, the server may also introduce N-gram vectors at the time of word segmentation. The word sequence after word segmentation is carried out on the question answers is determined through the obtained vector features, the content of the question answers is more accurately embodied, and the accuracy of emotion classification of the text to be classified is effectively improved.
One for each question. The server acquires the mapping relation between the problem and the sub-model, and calls the sub-model corresponding to the problem according to the mapping relation. The server inputs the words obtained by word segmentation into a sub-model, and the sub-model is utilized to carry out emotion classification on the words corresponding to the question answers so as to obtain emotion scores corresponding to the questions.
In this embodiment, the emotion score corresponding to the question is obtained by segmenting the question answer and invoking the sub-model corresponding to the question to perform emotion classification on the obtained word. And calling a corresponding sub-model aiming at the specific content of each problem to obtain the emotion score corresponding to the problem, thereby effectively improving the accuracy of emotion classification of the text to be classified.
In one embodiment, the server cleans the text to be classified after acquiring the text to be classified. Such as deleting text to be classified that does not conform to the preset rules. And performing emotion classification on the cleaned text to be classified. Specifically, the server divides the question answer into words, and calls a corresponding sub-model according to the question after obtaining a plurality of words. And arranging a plurality of words according to the requirements of the submodel, and arranging the words into a data form required by the submodel. For example, the server may sort the words into a table form, then input the words in the table form into the sub-model, and classify the emotion of the answer to the question by using the sub-model to obtain the emotion score corresponding to the question.
In this embodiment, after the text to be classified is obtained, the text to be classified is cleaned, the illegal text to be classified is removed, words obtained by word segmentation are arranged, a data form meeting the requirements of the sub-model is obtained, and the data form is input into the sub-model. The emotion classification efficiency of the text to be classified is effectively improved.
In one embodiment, after the step of identifying emotion types corresponding to the text to be classified according to emotion scores corresponding to the plurality of questions, the method further includes: and extracting the main body information according to the emotion type. As shown in fig. 3, this step specifically includes:
step 302, obtain emotion requirement type.
And step 304, matching the classified emotion type with the emotion demand type to obtain a corresponding first matching degree.
And 306, screening out emotion types meeting preset conditions according to the first matching degree.
Step 308, extracting the main body information corresponding to the emotion type.
The server acquires emotion demand types, wherein the emotion demand types are emotion types meeting the demands of users. The server can match emotion types obtained after emotion classification of the text to be classified with emotion types in various modes. Specifically, the server can match the emotion types obtained after classification with emotion demand types one by one, and can also call a plurality of threads to match emotion types in parallel. And after the server matches the emotion type with the emotion demand type, obtaining a first matching degree corresponding to the emotion type. The server screens the first matching degree corresponding to the emotion types and screens emotion types meeting preset conditions. The preset condition may be a condition preset by a user, for example, the emotion type with the first matching degree greater than a fixed value is screened out. The server extracts the main body information corresponding to the emotion type meeting the preset condition to obtain the main body information meeting the emotion demand type.
For example, in intelligent interview, the server performs emotion classification on the text to be classified provided by the interviewee to obtain an emotion type corresponding to the interviewee, the server can obtain an emotion demand type of a recruitment post, and the emotion type of the interviewee is matched with the emotion demand type of the post to obtain a first matching degree corresponding to a plurality of interviewees. The server screens according to the first matching degree, and screens out emotion types of which the first matching degree meets preset conditions, wherein the emotion types meet the post emotion requirement types. And the server extracts the subject information corresponding to the emotion type meeting the condition to obtain the subject information meeting the condition. The main body information of the interviewee matched with the post emotion demand type is screened out from emotion types of a plurality of interviewees, and the interviewee meeting the recruitment post demand is screened out from the interviewees according to the emotion types, so that the interviewing efficiency and accuracy are effectively improved.
In this embodiment, emotion types meeting preset conditions are screened out according to the first matching degree by matching the emotion types with emotion demand types, and screening meeting demands is performed by effectively utilizing the emotion types, so that main information meeting the demands is obtained, target screening modes are effectively enriched, and screening efficiency is improved.
In one embodiment, after the step of identifying emotion types corresponding to the text to be classified according to emotion scores corresponding to the plurality of questions, the method further includes: acquiring various product information, wherein the product information comprises product types; matching the product type with the classified emotion type to obtain a corresponding second matching degree; when the second matching degree is larger than a preset value, marking the product information corresponding to the product type as target product information; and extracting a terminal identifier corresponding to the emotion type, and pushing the target product information to a terminal corresponding to the terminal identifier.
The server acquires product information corresponding to various products, wherein the product information comprises corresponding product types. Products of different product types may be included in the plurality of products. For example, in foundation products, high risk high benefit type products are included, as are low risk low benefit type products. The server can match the product types of the various products with the classified emotion types in various ways. Specifically, the server can match product types corresponding to various products with emotion types in sequence, and can call a plurality of threads to process the product types and the emotion types in parallel to obtain a corresponding second matching degree. And when the second matching degree is larger than a preset value, marking the product information corresponding to the product type as target product information. Wherein the predetermined value is a value preset by a user. And when the second matching degree is larger than the preset value, the product corresponding to the product type is matched with the user corresponding to the emotion type. For example, a high risk high benefit type product matches a user biased toward risk, and a low risk low benefit type product matches a user biased toward conservation. The server extracts the terminal identification corresponding to the emotion type, pushes the target product information to the terminal corresponding to the terminal identification, and completes product information pushing conforming to emotion type matching.
In the embodiment, the product type is matched with the emotion type of the user, so that target product information conforming to the emotion type of the user is pushed to the user, and the accuracy of pushing the corresponding information is effectively improved.
It may be appreciated that in one embodiment, before obtaining multiple product information and matching a product category with an emotion type, an emotion demand type may also be obtained, and the classified emotion type and the emotion demand type are matched to obtain a corresponding first matching degree, and emotion types meeting a preset condition are screened according to the first matching degree.
And the server matches the multiple product types with the screened emotion types to obtain corresponding second matching degree, marks product information corresponding to the product types with the second matching degree larger than a preset value as target product information, and pushes the target product information to a terminal corresponding to the emotion type. The server can screen the user by using the emotion type and screen the user which accords with the emotion demand type. For example, the server may screen out a user who has a positive intention to purchase a product according to the emotion type, and then match the product type with the emotion type of the screened user, and screen out a product type that matches the emotion type of the user from a plurality of product types. The effect of pushing product information conforming to the emotion type of the user to the user with the intention to purchase is achieved.
In the embodiment, the emotion type screening and the product type screening are combined, so that the efficiency and the accuracy of product information pushing are effectively improved.
In one embodiment, the server builds a generic emotion classification model, which may employ Fasttext models. The server receives training set data, wherein the training set data can comprise a plurality of training texts, and the training texts comprise target questions, question answers corresponding to the target questions and target emotion scores corresponding to the question answers. Each target question may correspond to a plurality of question replies and a corresponding target emotion score. The server may train the generic emotion classification model using the training set data. Specifically, the server calls a sub-model in the general emotion classification model corresponding to the target problem, inputs the corresponding problem answer into the sub-model, and outputs a training emotion score through sub-model operation. The server can compare the training emotion scores with the target emotion scores, and adjust corresponding sub-models according to the comparison results. And after adjustment, repeatedly inputting the question answers into the corresponding sub-models, and adjusting the sub-models until the training emotion score is successfully compared with the target emotion score, thereby obtaining the target sub-model corresponding to the target question. The server trains the multiple sub-models by utilizing the target questions, the question answers and the target emotion scores in the multiple training texts so as to obtain a target emotion classification model.
In the embodiment, the training set data is utilized to train the general emotion classification model to obtain the target emotion classification model, so that the accuracy of the target emotion classification model is effectively improved.
It should be understood that, although the steps in the flowcharts of fig. 2-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in fig. 4, there is provided a text classification processing apparatus based on emotion, including: task acquisition module 402, text acquisition module 404, model invocation module 406, and emotion type identification module 408, wherein:
the task obtaining module 402 is configured to obtain an emotion classification task, where the emotion classification task includes a text identifier to be classified.
The text obtaining module 404 is configured to obtain a corresponding text to be classified according to the text to be classified identifier, where the text to be classified includes a plurality of questions and corresponding answers to the questions.
The model calling module 406 is configured to call a corresponding emotion classification model according to the emotion classification task, where the emotion classification model includes a plurality of sub-models; and inputting the questions and the corresponding answers to the questions into the corresponding submodels, and outputting emotion scores corresponding to the questions through submodel operation.
Emotion type identification module 408 is configured to identify an emotion type corresponding to the text to be classified according to emotion scores corresponding to the plurality of questions.
In one embodiment, the model invoking module 406 is further configured to word the question answer to obtain a plurality of words; calling a corresponding sub-model according to the problem; and carrying out emotion classification on the words by using the sub-model to obtain emotion scores corresponding to the problems.
In one embodiment, as shown in fig. 5, after the emotion type recognition module 408, the emotion-based text classification processing device further includes:
the requirement type obtaining module 502 is configured to obtain an emotion requirement type.
And the emotion type matching module 504 is configured to match the classified emotion type with the emotion requirement type, so as to obtain a corresponding first matching degree.
And the emotion type screening module 506 is configured to screen emotion types that meet a preset condition according to the first matching degree.
The main body information extraction module 508 is configured to extract main body information corresponding to the emotion type.
In one embodiment, after the emotion type recognition module 408, the emotion-based text classification processing device further includes a product information pushing module, configured to obtain a plurality of product information, where the product information includes a product type; matching the product type with the classified emotion type to obtain a corresponding second matching degree; when the second matching degree is larger than a preset value, marking the product information corresponding to the product type as target product information; and extracting a terminal identifier corresponding to the emotion type, and pushing the target product information to a terminal corresponding to the terminal identifier.
In one embodiment, the emotion type identification module 408 is further configured to obtain a weight corresponding to each question; calculating according to the weight and the corresponding emotion score to obtain a modified score; accumulating the modified scores corresponding to the problems to obtain an emotion total score; and identifying the emotion type corresponding to the text to be classified according to the emotion total score.
For specific limitations on emotion-based text classification processing means, reference is made to the above limitation on emotion-based text classification processing method, and no further description is given here. The above-mentioned text classification processing device based on emotion may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing emotion-based text classification processing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a emotion-based text classification processing method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the steps of the above-described method embodiments when the computer program is executed.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (12)

1. A text classification processing method based on emotion, the method comprising:
acquiring emotion classification tasks uploaded by a plurality of terminals respectively, wherein the emotion classification tasks comprise text identifiers to be classified;
For each text to be classified, acquiring a corresponding text to be classified according to the text to be classified identification, wherein the text to be classified comprises a plurality of questions and corresponding question replies made for each question;
invoking a corresponding emotion classification model according to the emotion classification task, wherein the emotion classification model comprises a plurality of sub-models, different questions correspond to different sub-models, and each question corresponds to one sub-model;
Invoking a sub-model corresponding to a problem according to a mapping relation between the problem and the sub-model, inputting the problem answer into the sub-model corresponding to the corresponding problem, performing emotion classification processing on the problem answer through the sub-model to obtain probabilities of a plurality of emotion labels corresponding to the problem answer, performing calculation according to the probabilities of the plurality of emotion labels corresponding to the problem answer to obtain emotion scores corresponding to the problem answer, and outputting emotion scores corresponding to the problem answer;
According to the weight corresponding to each problem in the problems, weighting and accumulating the corresponding emotion scores to obtain emotion total scores corresponding to the problems, and identifying emotion types corresponding to the texts to be classified according to the emotion total scores;
acquiring emotion demand types, respectively matching emotion types corresponding to texts to be classified uploaded by the terminals with the emotion demand types to obtain first matching degrees corresponding to the emotion types, and screening emotion types meeting preset conditions according to the first matching degrees;
Acquiring a plurality of product information, wherein the product information comprises a product type;
And matching the product type with the screened emotion type meeting the preset condition to obtain a corresponding second matching degree, marking product information corresponding to the product type with the second matching degree larger than a preset value as target product information, extracting a terminal identifier corresponding to the screened emotion type meeting the preset condition, and pushing the target product information to a terminal corresponding to the terminal identifier.
2. The method of claim 1, wherein the performing emotion classification processing on the question answer through the sub-model to obtain probabilities that the question answer corresponds to a plurality of emotion tags, and performing calculation according to the probabilities that the question answer corresponds to a plurality of emotion tags to obtain emotion scores corresponding to the question answer corresponding to the question, includes:
word segmentation is carried out on the question answers to obtain a plurality of words;
And carrying out emotion classification processing on the words by using the submodel to obtain probabilities of the problem answers corresponding to a plurality of emotion labels, and calculating according to the probabilities of the plurality of emotion labels to obtain emotion scores corresponding to the corresponding problems of the problem answers.
3. The method of claim 1, wherein the matching the emotion types corresponding to the text to be classified uploaded by the plurality of terminals with the emotion requirement types to obtain a first matching degree corresponding to each emotion type, includes:
and calling a plurality of threads, and matching emotion types corresponding to the texts to be classified, which are uploaded by the terminals respectively, with the emotion demand types in parallel to obtain a first matching degree corresponding to each emotion type.
4. The method of claim 1, wherein after the emotion types meeting the preset condition are screened out according to the first matching degree, the method further comprises:
And extracting the main body information corresponding to the emotion type meeting the preset condition.
5. The method according to any one of claims 1 to 4, wherein the training step of the sub-model comprises:
Acquiring a training text, wherein the training text comprises a target question, a question answer corresponding to the target question and a target emotion score corresponding to the question answer;
Invoking a sub-model in the general emotion classification model corresponding to the target problem, inputting the problem answer corresponding to the target problem into the sub-model in the general emotion classification model, and outputting a training emotion score through sub-model operation;
and comparing the training emotion score with a target emotion score corresponding to the question answer, and adjusting the corresponding sub-model according to the comparison result until the training emotion score and the target emotion score are successfully compared, so as to obtain a target sub-model corresponding to the target question.
6. An emotion-based text classification processing device, the device comprising:
The task acquisition module is used for acquiring emotion classification tasks uploaded by the terminals respectively, wherein the emotion classification tasks comprise text identifiers to be classified;
The text acquisition module is used for acquiring corresponding texts to be classified according to the text to be classified identification for each text to be classified, wherein the texts to be classified comprise a plurality of questions and corresponding question replies made for each question;
The model calling module is used for calling a corresponding emotion classification model according to the emotion classification task, the emotion classification model comprises a plurality of sub-models, different questions correspond to different sub-models, each question corresponds to one sub-model, the sub-model corresponding to the question is called according to the mapping relation between the question and the sub-model, the question answer is input into the sub-model corresponding to the corresponding question, emotion classification processing is carried out on the question answer through the sub-model, the probability of the question answer corresponding to a plurality of emotion labels is obtained, calculation is carried out according to the probability of the plurality of emotion labels, the emotion score corresponding to the question answer corresponding to the question is obtained, and the emotion score corresponding to the question is output;
the emotion type identification module is used for weighting and accumulating the corresponding emotion scores according to the weight corresponding to each problem in the plurality of problems to obtain total emotion scores corresponding to the plurality of problems, and identifying emotion types corresponding to the text to be classified according to the total emotion scores;
the demand type acquisition module is used for acquiring emotion demand types;
The emotion type matching module is used for respectively matching emotion types corresponding to texts to be classified uploaded by the terminals with the emotion demand types to obtain first matching degrees corresponding to the emotion types;
the emotion type screening module is used for screening emotion types meeting preset conditions according to the first matching degree;
The product information pushing module is used for acquiring various product information, wherein the product information comprises product types; and matching the product type with the screened emotion type meeting the preset condition to obtain a corresponding second matching degree, marking product information corresponding to the product type with the second matching degree larger than a preset value as target product information, extracting a terminal identifier corresponding to the screened emotion type meeting the preset condition, and pushing the target product information to a terminal corresponding to the terminal identifier.
7. The apparatus of claim 6, wherein the model invoking module is further configured to word the question answer to obtain a plurality of words; and carrying out emotion classification processing on the words by using the submodel to obtain probabilities of the problem answers corresponding to a plurality of emotion labels, and calculating according to the probabilities of the plurality of emotion labels to obtain emotion scores corresponding to the corresponding problems of the problem answers.
8. The apparatus of claim 6, wherein the emotion type matching module is further configured to invoke a plurality of threads to match emotion types corresponding to texts to be classified uploaded by the plurality of terminals with the emotion demand types in parallel, so as to obtain a first matching degree corresponding to each emotion type.
9. The apparatus of claim 6, wherein the apparatus further comprises:
and the information extraction module is used for extracting the main body information corresponding to the emotion type meeting the preset condition.
10. The apparatus according to any one of claims 6 to 9, further comprising:
the training module is used for acquiring training texts, wherein the training texts comprise target questions, question answers corresponding to the target questions and target emotion scores corresponding to the question answers; invoking a sub-model in the general emotion classification model corresponding to the target problem, inputting the problem answer corresponding to the target problem into the sub-model in the general emotion classification model, and outputting a training emotion score through sub-model operation; and comparing the training emotion score with a target emotion score corresponding to the question answer, and adjusting the corresponding sub-model according to the comparison result until the training emotion score and the target emotion score are successfully compared, so as to obtain a target sub-model corresponding to the target question.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN201910042837.5A 2019-01-17 2019-01-17 Text classification processing method and device based on emotion and computer equipment Active CN109960725B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910042837.5A CN109960725B (en) 2019-01-17 Text classification processing method and device based on emotion and computer equipment
PCT/CN2019/117161 WO2020147395A1 (en) 2019-01-17 2019-11-11 Emotion-based text classification method and device, and computer apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910042837.5A CN109960725B (en) 2019-01-17 Text classification processing method and device based on emotion and computer equipment

Publications (2)

Publication Number Publication Date
CN109960725A CN109960725A (en) 2019-07-02
CN109960725B true CN109960725B (en) 2024-06-21

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108513175A (en) * 2018-03-29 2018-09-07 网宿科技股份有限公司 A kind of processing method and system of barrage information

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108513175A (en) * 2018-03-29 2018-09-07 网宿科技股份有限公司 A kind of processing method and system of barrage information

Similar Documents

Publication Publication Date Title
CN110765265B (en) Information classification extraction method and device, computer equipment and storage medium
CN109871446B (en) Refusing method in intention recognition, electronic device and storage medium
CN109165840B (en) Risk prediction processing method, risk prediction processing device, computer equipment and medium
CN111859960B (en) Semantic matching method, device, computer equipment and medium based on knowledge distillation
CN109729383B (en) Double-recording video quality detection method and device, computer equipment and storage medium
WO2021068321A1 (en) Information pushing method and apparatus based on human-computer interaction, and computer device
CN109829629B (en) Risk analysis report generation method, apparatus, computer device and storage medium
WO2021114840A1 (en) Scoring method and apparatus based on semantic analysis, terminal device, and storage medium
WO2020147395A1 (en) Emotion-based text classification method and device, and computer apparatus
CN109872162B (en) Wind control classification and identification method and system for processing user complaint information
CN111191032B (en) Corpus expansion method, corpus expansion device, computer equipment and storage medium
CN108520041B (en) Industry classification method and system of text, computer equipment and storage medium
CN108491406B (en) Information classification method and device, computer equipment and storage medium
CN111783471B (en) Semantic recognition method, device, equipment and storage medium for natural language
CN110717021B (en) Input text acquisition and related device in artificial intelligence interview
CN111309881A (en) Method and device for processing unknown questions in intelligent question answering, computer equipment and medium
CN110633475A (en) Natural language understanding method, device and system based on computer scene and storage medium
CN110931012A (en) Reply message generation method and device, computer equipment and storage medium
CN113240510A (en) Abnormal user prediction method, device, equipment and storage medium
CN112632248A (en) Question answering method, device, computer equipment and storage medium
CN111400340A (en) Natural language processing method and device, computer equipment and storage medium
CN112464660B (en) Text classification model construction method and text data processing method
CN113850077A (en) Topic identification method, device, server and medium based on artificial intelligence
CN113762392A (en) Financial product recommendation method, device, equipment and medium based on artificial intelligence
CN109960725B (en) Text classification processing method and device based on emotion and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant