CN111310882A - Method and apparatus for generating information - Google Patents

Method and apparatus for generating information Download PDF

Info

Publication number
CN111310882A
CN111310882A CN201811508447.4A CN201811508447A CN111310882A CN 111310882 A CN111310882 A CN 111310882A CN 201811508447 A CN201811508447 A CN 201811508447A CN 111310882 A CN111310882 A CN 111310882A
Authority
CN
China
Prior art keywords
user input
input information
category
information
user
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.)
Pending
Application number
CN201811508447.4A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811508447.4A priority Critical patent/CN111310882A/en
Publication of CN111310882A publication Critical patent/CN111310882A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/008Artificial life, i.e. computing arrangements simulating life based on physical entities controlled by simulated intelligence so as to replicate intelligent life forms, e.g. based on robots replicating pets or humans in their appearance or behaviour

Abstract

The embodiment of the application discloses a method and a device for generating information. One embodiment of the method comprises: acquiring user input information input by a user; inputting user input information into a pre-trained classification model so as to determine a user input information category to which the user input information belongs from a pre-determined user input information category set; generating reply information of the user input information based on the determined user input information category. The embodiment enriches the information generation mode and is beneficial to improving the pertinence of information generation.

Description

Method and apparatus for generating information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating information.
Background
At present, a network robot for receiving a user is produced. The significance of analyzing the text is increasingly prominent when the robot communicates with the user.
A large amount of user's consultation information, comment information, etc. are generated every day on the network platform. These information express the user's emotional tendencies to the event, such as "angry", "happy", "disappointed", "urgent", and so on. Because of the enormous amount of information, it is difficult to rely on manual processing alone, and therefore a computer is required to identify and classify the information.
In the existing classification technology, the number of classes is usually fixed, and when the classes are increased, the model is required to be retrained.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating information.
In a first aspect, an embodiment of the present application provides a method for generating information, where the method includes: acquiring user input information input by a user; inputting user input information into a pre-trained classification model so as to determine a user input information category to which the user input information belongs from a pre-determined user input information category set; generating reply information of the user input information based on the determined user input information category.
In some embodiments, generating reply information for the user input information based on the determined category of user input information comprises: in response to determining that the determined user input information category is a target user input information category in the set of user input information categories, selecting information from a set of information predetermined for the target user input information category as reply information for the user input information.
In some embodiments, generating reply information for the user input information based on the determined category of user input information comprises: in response to determining that the determined user input information category is a target user input information category in the set of user input information categories, inputting the user input information to a reply information generation model pre-trained for the target user input information category, generating reply information for the user input information.
In some embodiments, inputting the user input information into a pre-trained classification model to determine a user input information category to which the user input information belongs from a predetermined set of user input information categories comprises: inputting user input information into a pre-trained classification model to obtain a value for representing emotion of a user for representing the input user input information, wherein the value for representing emotion is used for representing emotion of the user for inputting the user input information; and determining the user input information category to which the user input information belongs from a predetermined user input information category set according to the magnitude relation between the value for representing the emotion and a threshold value in a preset threshold value set.
In some embodiments, prior to obtaining the user input information entered by the user, the method further comprises: and in response to the fact that a new user input information category set is obtained after a preset number of user input information categories are added to a predetermined user input information category set, adding a preset number of threshold values to a preset threshold value set, and obtaining a new threshold value set.
In some embodiments, determining a user input information category to which the user input information belongs from a predetermined set of user input information categories according to a magnitude relationship between the value characterizing emotion and a threshold value in a preset set of threshold values includes: and determining the user input information category to which the user input information belongs from the new user input information category set according to the magnitude relation between the value for representing the emotion and the threshold value in the new threshold value set.
In some embodiments, the number of user input information categories in the set of user input information categories is greater than three.
In a second aspect, an embodiment of the present application provides an apparatus for generating information, where the apparatus includes: an acquisition unit configured to acquire user input information input by a user; an input unit configured to input user input information to a pre-trained classification model to determine a user input information category to which the user input information belongs from a pre-determined set of user input information categories; a generating unit configured to generate reply information of the user input information based on the determined user input information category.
In some embodiments, the generating unit comprises: a selection module configured to select information from a set of information predetermined for a target user input information category as reply information for the user input information in response to determining that the determined user input information category is the target user input information category in the set of user input information categories.
In some embodiments, the generating unit comprises: a generation module configured to, in response to determining that the determined user input information category is a target user input information category of the set of user input information categories, input the user input information to a reply information generation model pre-trained for the target user input information category, generate reply information for the user input information.
In some embodiments, the input unit includes: the input module is configured to input the user input information into a pre-trained classification model to obtain a value for representing emotion of a user for representing the input user input information, wherein the value for representing emotion is used for representing emotion of the user for inputting the user input information; the first determining module is configured to determine a user input information category to which the user input information belongs from a predetermined user input information category set according to the magnitude relation between the value for representing the emotion and a threshold value in a preset threshold value set.
In some embodiments, the apparatus further comprises: and the adding unit is configured to respond to a situation that a new user input information category set is obtained after a preset number of user input information categories are determined to be added to a predetermined user input information category set, and a preset number of threshold values are added to a preset threshold value set to obtain a new threshold value set.
In some embodiments, the input unit includes: and the second determination module is configured to determine the user input information category to which the user input information belongs from the new user input information category set according to the magnitude relation between the value for representing the emotion and the threshold value in the new threshold value set.
In some embodiments, the number of user input information categories in the set of user input information categories is greater than three.
In a third aspect, an embodiment of the present application provides an electronic device for generating information, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments of the method for generating information as described above.
In a fourth aspect, the present application provides a computer-readable medium for generating information, on which a computer program is stored, which when executed by a processor implements the method of any one of the embodiments of the method for generating information as described above.
According to the method and the device for generating the information, the user input information input by the user is acquired, then the user input information is input into the pre-trained classification model, the user input information category to which the user input information belongs is determined from the pre-determined user input information category set, and finally the reply information of the user input information is generated based on the determined user input information category, so that the reply information of the user input information is obtained according to the category of the user input information, and therefore, the generation mode of the information is enriched, and the pertinence of information generation is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for generating information according to the present application;
FIG. 3 is a schematic illustration of an application scenario of a method for generating information according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for generating information according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for generating information according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of a method for generating information or an apparatus for generating information of embodiments of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 101, 102, 103 to interact with the server 105 over the network 104 to receive or send messages (e.g., user input information entered by the user), etc. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting page browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background server that classifies user input information input by the user acquired from the terminal devices 101, 102, 103. The background server can classify data such as user input information and the like, generate reply information of the user input information according to a classification result, and feed back a processing result (such as the reply information of the user input information) to the terminal device.
It should be noted that the method for generating information provided in the embodiment of the present application may be executed by the server 105, and accordingly, the apparatus for generating information may be disposed in the server 105. In addition, the method for generating information provided by the embodiment of the present application may also be executed by the terminal devices 101, 102, and 103, and accordingly, the apparatus for generating information may also be disposed in the terminal devices 101, 102, and 103.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the method for generating information is run does not need to perform data transmission with other electronic devices, the system architecture may include only the electronic device (e.g., the terminal device 101, 102, 103 or the server 105) on which the method for generating information is run.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for generating information in accordance with the present application is shown. The method for generating information comprises the following steps:
step 201, obtaining user input information input by a user.
In this embodiment, an execution subject of the method for generating information (e.g., a server or a terminal device shown in fig. 1) may obtain user input information input by a user from other electronic devices or locally through a wired connection manner or a wireless connection manner.
The user input information may be information input by a user through a terminal device used by the user. The user input information may be information presented in a comment area of the page, or information for making a consultation on a consultation page. For example, the user input information may be information for evaluating a product, or information for consulting a price, a logistics state, a return state, and the like of the product.
Here, when the execution main body is a terminal device, the execution main body may directly obtain user input information input by a user; when the execution agent is a server, the execution agent may acquire the user input information from a terminal device used by a user.
Step 202, inputting the user input information into a pre-trained classification model, so as to determine a user input information category to which the user input information belongs from a pre-determined user input information category set.
In this embodiment, the executing entity may input the user input information acquired in step 201 into a classification model trained in advance, so as to determine a user input information category to which the user input information belongs from a set of predetermined user input information categories.
The classification model described above may be used to classify user input information. The classification model may be used to characterize a correspondence between user input information and a category of user input information to which the user input information belongs. Optionally, the classification model may also be configured to represent a correspondence between the user input information and a value for characterizing emotion (a value for characterizing emotion of the user) of the user who inputs the user input information, in this application scenario, a technician may set a threshold in advance, and the execution main body may determine a user input information category to which the user input information belongs from a set of predetermined user input information categories by comparing a size relationship between the value for characterizing emotion and the preset threshold, and may understand that the number of the set threshold may be one less than the number of the user input information categories in the set of user input information categories.
As an example, the classification model may be, but is not limited to, any of the following: naive bayes, decision trees, support vector machines, random forests, and the like.
For example, the classification model may be a table or a database, which is obtained by a technician through a large number of statistics and stores the user input information and the user input information category to which the user input information belongs.
Alternatively, the classification model may be a model obtained by a technician based on training an initial model (e.g., a convolutional neural network).
Specifically, the executing entity or other electronic device may train to obtain the classification model according to the following steps:
in a first step, a set of training samples is obtained. The training sample comprises user input information and a user input information category to which the user input information belongs. The user input information category may be a category of user input information that is manually labeled. The user input information category may be a user input information category to which the user input information belongs, which is determined by the annotating person from the set of user input information categories, or may be automatically annotated by the execution subject or other electronic devices communicatively connected thereto based on predetermined rules. For example, the predetermined rule may be "if the user input information includes a specific word (e.g., thank you), the user input information category to which the user input information belongs may be a specific category (e.g., happy thank you) in the user input information category set".
And secondly, using a machine learning algorithm, taking the user input information included in the training sample as the input of the initial model, taking the user input information category labeled aiming at the input user input information as the expected output of the initial model, and training to obtain a classification model. The initial model may be an untrained model, or may be a model that has been trained but is not trained. For example, the initial model may be a logistic regression model.
Here, the executing agent may determine a model satisfying at least one of the following conditions as a trained classification model: the training time exceeds the preset time; the training times exceed the preset times; the calculated difference (e.g., euclidean distance between the feature vector of the actual output of the model and the feature vector of the desired output, etc.) is less than a preset difference threshold.
The user input information category may characterize a category to which the user input information belongs. Illustratively, the user input information category may be, but is not limited to, any of: happiness, anger, loss, anxiety, loss of consciousness, worry, others, etc. The number of user input information categories included in the set of user input information categories may be arbitrary. For example, the number of user input information categories included in the above-mentioned set of user input information categories may be 2, 3, or a positive integer greater than 3, and so on.
In some optional implementations of this embodiment, the number of user input information categories in the set of user input information categories is greater than three. For example, the number of the user input information categories in the user input information category set may be 4, 5, 6, 7, or other positive integers greater than 3. For example, the set of user input information categories may be comprised of the following user input information categories: happy thank you, anger, loss of life, anxiety, loss of consciousness, worry, and others.
It can be understood that, the execution main body may classify the user input information more finely as the number of user input information categories included in the user input information category set is larger, and therefore, when the number of user input information categories in the user input information category set is greater than three, the execution main body may classify the user input information more finely as compared to when the number of user input information categories in the user input information category set is less than or equal to three, which is helpful to obtain reply information of the user input information more specifically.
And step 203, generating reply information of the user input information based on the determined user input information category.
In this embodiment, the execution subject may generate reply information of the user input information based on the determined category of the user input information. Wherein, the reply information can be used for replying the input information of the user.
In some optional implementations of this embodiment, the executing main body may execute the step 203 according to the following steps: in a case where the determined user input information category is determined to be a target user input information category in the set of user input information categories, the execution subject may select information from the set of information predetermined for the target user input information category as reply information of the user input information.
Here, the target user input information category may be any one or more user input information categories in the set of user input information categories, or may be one or more predetermined user input information categories in the set of user input information categories.
The execution main body may randomly select information from the information set as reply information of the user input information, or the execution main body may send the user input information to a terminal device used by a replying person (e.g., a customer service), and the replying person determines information from the information set. Then, the replying person sends the determined information to the execution main body through the terminal device, and then the execution main body takes the received information as the reply information of the user input information selected by the execution main body.
Optionally, the executing body may also calculate a matching degree between each piece of information in the information set and the user input information, so as to use the piece of information in the information set with the highest matching degree as the reply information of the user input information. For each information in the information set, the matching degree may be determined according to the following steps: in a predetermined text (for example, a text including a large number of dialogue sentences), the frequency of the information as reply information to the user input information is determined as the degree of matching between the information and the user input information.
It will be appreciated that reply information to the user input information may be generated more specifically by determining whether the user input information belongs to the target user input information category. For example, if the target user input information category is "angry", when the user input information belongs to the target user input information category, the execution main body may select information from an information set (for example, a set of information for replying and soothing to the user input information input by the angry user) determined in advance for the target user input information category, as the reply information of the user input information, so that the emotion of the user may be soothed.
In some optional implementations of this embodiment, the executing main body may further execute the step 203 according to the following steps: in a case where the determined user input information category is determined to be a target user input information category in the set of user input information categories, the execution subject may input the user input information to a reply information generation model trained in advance for the target user input information category, and generate reply information of the user input information.
The execution subject may train one reply information generation model in advance for each user input information category in the user input information category set, or may train a reply information generation model in advance only for a target user input information category. Wherein the reply information generation model may be used to generate reply information for user input information belonging to the target user input information category.
For each user input information category in the user input information category set, the reply information generation model trained for the user input information category may be a table or a database which is obtained by technicians through a large number of statistics and stores the reply information of the user input information and the user input information belonging to the user input information category and relationship information representing the corresponding relationship therebetween.
Optionally, the reply information generation model may also be a model obtained by a technician based on training an initial model (e.g., a convolutional neural network).
Here, for each user input information category in the set of user input information categories, the executing entity may train to obtain a reply information generation model for the user input information category according to the following steps:
in a first step, a set of training samples is obtained. The training sample comprises user input information and reply information of the user input information. The user input information and the reply information of the user input information may be manually determined in advance, or may be obtained from a preset dialog text. The category to which the user input information included in the training samples in the training sample set belongs is the category of the user input information.
And secondly, using a machine learning algorithm, taking the user input information included in the training sample as the input of the initial model, taking the reply information of the input user input information as the expected output of the initial model, and training to obtain a reply information generation model. The initial model may be an untrained model, or may be a model that has been trained but is not trained. For example, the initial model may be a logistic regression model.
Here, the executing agent may determine a model satisfying at least one of the following conditions as the trained reply information generation model: the training time exceeds the preset time; the training times exceed the preset times; the calculated difference (e.g., euclidean distance between the actual output and the expected output of the model, etc.) is less than a preset difference threshold.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for generating information according to the present embodiment. In the application scenario of fig. 3, the user inputs user input information 301 into the terminal device (in the figure, "my return, how has not yet been received. Then, the server acquires user input information 301 input by the user from the terminal device. The server then inputs the user input information into a pre-trained classification model, and determines a user input information category (e.g., worry) to which the user input information 301 belongs from a set of pre-determined user input information categories (e.g., including happy, angry, lost, anxious, lost, worried, other). Finally, the server generates reply information 302 (in the diagram, "the return and exchange of goods is completed within 7 days from the date of receiving the problem product after sale, and the time of the product is correspondingly prolonged by 7-15 days if the product needs to be detected") and reply information 303 (in the diagram, "your worried heart sister is well understood, and your product needs a professional to detect and confirm that a specific fault is processed by you and please be relieved) of the user input information based on the determined user input information category.
According to the method provided by the embodiment of the application, the acquired user input information is input into the pre-trained classification model, so that the user input information category to which the user input information belongs is determined from the pre-determined user input information category set, and the reply information of the user input information is generated based on the determined user input information category, so that the information generation mode is enriched, and the information generation pertinence is improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for generating information is shown. The flow 400 of the method for generating information comprises the steps of:
step 401, obtaining user input information input by a user.
In this embodiment, step 401 is substantially the same as step 201 in the corresponding embodiment of fig. 2, and is not described here again.
Step 402, inputting the user input information into a pre-trained classification model to obtain a value for representing the emotion of the user who inputs the user input information.
In this embodiment, an executive (e.g., the server or the terminal device shown in fig. 1) of the method for generating information may input the user input information into a pre-trained classification model, and obtain a value for characterizing emotion of the user who inputs the user input information. Wherein the value for characterizing emotion may be used to characterize the emotion of the user inputting the user input information.
Here, the classification model may be used to characterize a correspondence between user input information and a value characterizing emotion of a user who inputs the user input information.
As an example, the classification model may be obtained by training the execution subject or an electronic device communicatively connected thereto according to the following steps:
the method comprises the steps of firstly, respectively obtaining user input information belonging to each user input information category in a user input information category set, and aiming at each obtained user input information, forming a training sample by the user input information and the user input information category to which the user input information belongs. Thereby resulting in a plurality of training samples for each user input information category.
And secondly, aiming at each user input information category in the user input information category set, performing the following operation on each training sample in a plurality of training samples of the user input information category to obtain a classification submodel aiming at the user input information category: the initial model (e.g., convolutional neural network) is trained using a machine learning algorithm, with the user input information included in the training sample as input and the user input information category included in the training sample as expected output.
And thirdly, obtaining a classification submodel aiming at each user input information category in the user input information category set according to the mode of the second step. Further, the classification submodels may be combined into the classification model.
It can be understood that the obtained classification model can be used to predict the user input information, so as to obtain the probability that the user input information belongs to each user input information category corresponding to each classification submodel. In this application scenario, the value characterizing emotion may be a set of probabilities obtained by each classification submodel included in the classification model.
Optionally, the executing entity or the electronic device communicatively connected to the executing entity may also train to obtain a classification model according to the following steps:
in a first step, a set of training samples is obtained. The number of classes of the training samples included in the training sample set may be consistent with the number of user input information classes in the user input information class set. In other words, for each user input information category in the set of user input information categories, a plurality of training samples corresponding to that category may be obtained. For each training sample included in the set of training samples, the training sample may include user input information and a category of user input information to which the user input information belongs.
And secondly, training an initial model (such as a logistic regression model, a convolutional neural network and the like) by using a machine learning algorithm and taking the user input information included in the training sample as input, taking the user input information category to which the input user input information belongs as expected output, thereby obtaining a classification model.
It will be appreciated that the above classification model may be used to derive probabilities that the input user input information belongs to respective categories of user input information in the user input information, where the above value for characterizing emotion may be a set of derived probabilities.
Step 403, according to the magnitude relation between the value for representing emotion and the threshold in the preset threshold set, determining the user input information category to which the user input information belongs from the predetermined user input information category set.
In this embodiment, the execution subject may determine the user input information category to which the user input information belongs from a predetermined set of user input information categories according to a magnitude relationship between the value for characterizing emotion and a threshold value in a preset set of threshold values.
Here, the technician may determine the correspondence between the value for characterizing emotion and the emotion of the user according to actual needs. As an example, taking the value range of the value for representing emotion (or the probability included in the value for representing emotion) from 0 (including 0) to 1 (including 1) as an example, the skilled person may determine the emotion of the user corresponding to the value for representing emotion (or the probability for the user input information category "happy thank" included in the value for representing emotion) belonging to the range of (0.9, 1] interval as "happy thank", determine the emotion of the user corresponding to the value for representing emotion (or the probability for the user input information category "worries" included in the value for representing emotion) belonging to the range of (0.7, 0.9] interval as "worries", determine the emotion of the user corresponding to the value for representing emotion (or the probability for the user input information category "worries" included in the value for representing emotion) belonging to the range of (0.5, 0.7] interval as "lost", determining the emotion of the user corresponding to the value for representing emotion (or the probability of "angry" included in the value for representing emotion) belonging to the range of (0.35, 0.5) interval as "angry", the emotion of the user corresponding to the value for characterizing emotion (or the probability for the user input information category "anxiety" included in the value for characterizing emotion) belonging to the range of (0.2, 0.35] interval is determined as "anxiety", the emotion of the user corresponding to the value for characterizing emotion (or the probability for the user input information category "lost" included in the value for characterizing emotion) belonging to the range of (0.1, 0.2] interval is determined as "lost", the emotion of the user corresponding to the value for characterizing emotion (or the probability for the user input information category "other" included in the value for characterizing emotion) belonging to the range of [0, 0.1] interval is determined as "other".
Then, the execution body may sequentially compare the probability included in the numerical value for representing emotion and belonging to each user input information category in the user input information with a threshold set for the user input information category, thereby determining the user input information category to which the user input information belongs.
For example, the executing entity may compare the magnitude relationship between the set threshold and the corresponding value for characterizing emotion (or the probability included in the value for characterizing emotion) in descending order of the threshold. For example, the executing agent may first determine whether the value characterizing emotion (or the probability characterizing user input information included in the value characterizing emotion and being in the user input information category "happy thank") is greater than a threshold value (e.g., 0.9) set for the user input information category "happy thank"), if so, determine that the user input information belongs to the user input information category "happy thank", if less than or equal to, continue to determine whether the value characterizing emotion (or the probability characterizing user input information included in the value characterizing user input information being in the user input information category "worries") is greater than a threshold value (e.g., 0.7) set for the user input information category "worries", if so, determine that the user input information belongs to the user input information category "worries", if less than or equal to, the determination of whether the value characterizing emotion (or the probability that the value characterizing emotion includes information characterizing the user input to the next category of user input information) is greater than the threshold set for the category of user input information continues until the category of user input information to which the user input information belongs is determined.
Optionally, the value for characterizing emotion may also be a result of weighted summation of probabilities obtained by the classification model, and thus, the executing body may further determine, from a predetermined set of user input information categories, a user input information category to which the user input information belongs by determining a magnitude relationship between the value for characterizing emotion and a threshold in the preset set of thresholds.
Step 404, generating reply information of the user input information based on the determined user input information category.
In this embodiment, step 404 is substantially the same as step 203 in the corresponding embodiment of fig. 2, and is not described herein again.
In some optional implementations of this embodiment, before performing step 401, the executing main body may further: and under the condition that a new user input information category set is obtained after a preset number of user input information categories are added into a predetermined user input information category set, re-determining a new threshold set. Wherein the preset number may be a predetermined positive integer. For example, the preset number may be 1 or 2, and so on. The new user input information category set may be a user input information category set obtained by adding a preset number of user input information categories to a predetermined user input information category set. The new re-determined threshold value set may be determined by adding a threshold value to the threshold value set determined for the predetermined user input information category set, or may be obtained by re-setting a threshold value for each user input information category in the new user input information category set.
In some optional implementations of this embodiment, before performing step 401, the executing main body may further: and under the condition that a new user input information category set is obtained after a preset number of user input information categories are determined to be added to a predetermined user input information category set, adding the preset number of thresholds to the preset threshold set to obtain a new threshold set. Wherein the preset number may be a predetermined positive integer. For example, the preset number may be 1 or 2, and so on. The new user input information category set may be a user input information category set obtained by adding a preset number of user input information categories to a predetermined user input information category set.
In some optional implementations of this embodiment, the executing main body may execute the step 403 according to the following steps: and determining the user input information category to which the user input information belongs from the new user input information category set according to the magnitude relation between the value for representing the emotion and the threshold value in the new threshold value set.
As an example, assume that the predetermined set of user input information categories consists of "happy thank, worried, other" user input information categories. If 4 user input information categories "lost, angry, anxious, lost" currently need to be added to the set of user input information categories to get a new set of user input information categories "happy, anxious, lost, angry, anxious, lost, other". In this scenario, when the set of thresholds (e.g., 0.9, 0.7) set for the predetermined set of user input information categories is less than or equal to 0.7, the emotion of the user corresponding to the value representing emotion may be determined as "other") by adding 4 thresholds (e.g., 0.5, 0.35, 0.2, 0.1), resulting in a new set of thresholds (e.g., 0.9, 0.7, 0.5, 0.35, 0.2, 0.1). Then, the executing body may determine a user input information category to which the user input information belongs from the new set of user input information categories according to a magnitude relationship between the value for characterizing emotion and a threshold value in the new set of threshold values.
It should be noted that, after the new threshold set is used as the preset threshold set in step 403, and the new user input information category set is used as the predetermined user input information category set in step 403, the method for determining the user input information category to which the user input information belongs from the new user input information category set according to the magnitude relationship between the value for representing emotion and the threshold in the new threshold set is basically the same as the execution method of step 403, and is not described herein again.
In this application scenario, when a user input information needs to be classified with finer granularity, the model only needs to be trained again for the newly added user input information categories, and a new threshold set is set, so that the requirement for classifying the user input information with finer granularity can be met. Therefore, the granularity for classifying the user input information can be adjusted more flexibly, and the efficiency of classifying different granularities for the user input information is improved. In the prior art, when the granularity for classifying the user input information needs to be changed, the whole model often needs to be retrained, and the classification model obtained by training before the change cannot be suitable for new requirements. By the method, the steps of further training and the like are only needed on the basis of the original model, so that the flexibility of information classification is improved.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for generating information in the present embodiment highlights the step of determining the category of the user input information to which the user input information belongs by characterizing the value of emotion. Therefore, the scheme described in this embodiment can introduce more determination modes of the user input information category, so as to further enrich the information generation mode, and can realize classification of user input information of finer granularity, thereby further improving the pertinence and flexibility of information generation. In addition, when the granularity for classifying the information input by the user needs to be changed, the steps of further training and the like can be performed on the basis of the original model, so that the flexibility of information classification is improved.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for generating information, which corresponds to the embodiment of the method shown in fig. 2, and which may include the same or corresponding features as the embodiment of the method shown in fig. 2, in addition to the features described below. The device can be applied to various electronic equipment.
As shown in fig. 5, the apparatus 500 for generating information of the present embodiment includes: an acquisition unit 501, an input unit 502, and a generation unit 503. Wherein the obtaining unit 501 is configured to obtain user input information input by a user; the input unit 502 is configured to input user input information to a pre-trained classification model to determine a user input information category to which the user input information belongs from a pre-determined set of user input information categories; the generating unit 503 is configured to generate reply information of the user input information based on the determined category of the user input information.
In this embodiment, the obtaining unit 501 of the apparatus 500 for generating information may obtain the user input information input by the user from other electronic devices through a wired connection manner or a wireless connection manner, or locally.
The user input information may be information input by a user through a terminal device used by the user. The user input information may be information presented in a comment area of the page, or information for making a consultation on a consultation page. For example, the user input information may be information for evaluating a product, or information for consulting a price, a logistics state, a return state, and the like of the product.
In this embodiment, the input unit 502 may input the user input information obtained by the obtaining unit 501 into a classification model trained in advance, so as to determine a user input information category to which the user input information belongs from a set of predetermined user input information categories.
The classification model described above may be used to classify user input information. The classification model may be used to characterize a correspondence between user input information and a category of user input information to which the user input information belongs. Optionally, the classification model may also be used to characterize a corresponding relationship between the user input information and a value for characterizing emotion of the user who inputs the user input information.
In this embodiment, the generating unit 503 may generate reply information of the user input information based on the user input information category determined by the input unit 502. Wherein, the reply information can be used for replying the input information of the user.
In some optional implementations of this embodiment, the generating unit includes: the selecting module (not shown in the figures) is configured to select information from a set of information predetermined for a target user input information category as reply information to the user input information in response to determining that the determined user input information category is the target user input information category in the set of user input information categories.
Here, the target user input information category may be any one or more user input information categories in the set of user input information categories, or may be one or more predetermined user input information categories in the set of user input information categories.
In some optional implementations of this embodiment, the generating unit includes: a generation module (not shown in the figures) is configured to, in response to determining that the determined user input information category is a target user input information category of the set of user input information categories, input the user input information to a reply information generation model pre-trained for the target user input information category, generate reply information for the user input information.
The execution subject may train one reply information generation model in advance for each user input information category in the user input information category set, or may train a reply information generation model in advance only for a target user input information category. Wherein, the reply information generation model can be used for generating reply information of the user input information category.
In some optional implementations of this embodiment, the input unit includes: an input module (not shown in the figure) is configured to input the user input information into a pre-trained classification model, and obtain a value for representing emotion of the user for representing the input user input information, wherein the value for representing emotion is used for representing emotion of the user for inputting the user input information; the first determining module (not shown in the figure) is configured to determine a user input information category to which the user input information belongs from a predetermined set of user input information categories according to a magnitude relation between the value characterizing the emotion and a threshold value in a preset set of threshold values.
Here, the classification model may be used to characterize a correspondence between user input information and a value characterizing emotion of a user who inputs the user input information. The corresponding relation between the value for representing the emotion and the emotion of the user can be determined by the technical personnel according to the actual requirement.
In some optional implementations of this embodiment, the apparatus 500 further includes: the adding unit (not shown in the figures) is configured to, in response to determining that a preset number of user input information categories are added to the predetermined set of user input information categories to obtain a new set of user input information categories, add a preset number of thresholds to the preset set of thresholds to obtain a new set of thresholds.
Wherein the preset number may be a predetermined positive integer. For example, the preset number may be 1 or 2, and so on. The new user input information category set may be a user input information category set obtained by adding a preset number of user input information categories to a predetermined user input information category set.
In some optional implementations of this embodiment, the input unit includes: a second determining module (not shown in the figure) is configured to determine a user input information category to which the user input information belongs from the new set of user input information categories according to a magnitude relation between the value characterizing the emotion and a threshold value in the new set of threshold values.
In some optional implementations of this embodiment, the number of user input information categories in the set of user input information categories is greater than three.
In the apparatus provided by the above embodiment of the present application, the obtaining unit 501 obtains the user input information input by the user, then the input unit 502 inputs the user input information into the pre-trained classification model to determine the user input information category to which the user input information belongs from the pre-determined user input information category set, and finally the generating unit 503 generates the reply information of the user input information based on the determined user input information category, so that the generation manner of the information is enriched, and the pertinence of the information generation is improved.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Python, Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, an input unit, and a generation unit. The names of these units do not in some cases constitute a limitation on the units themselves, and for example, the acquisition unit may also be described as a "unit that acquires user input information input by a user".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring user input information input by a user; inputting user input information into a pre-trained classification model so as to determine a user input information category to which the user input information belongs from a pre-determined user input information category set; generating reply information of the user input information based on the determined user input information category.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for generating information, comprising:
acquiring user input information input by a user;
inputting the user input information into a pre-trained classification model so as to determine a user input information category to which the user input information belongs from a pre-determined user input information category set;
generating reply information for the user input information based on the determined category of the user input information.
2. The method of claim 1, wherein the generating reply information to the user input information based on the determined category of user input information comprises:
in response to determining that the determined user input information category is a target user input information category in the set of user input information categories, selecting information from a set of information predetermined for the target user input information category as reply information for the user input information.
3. The method of claim 1, wherein the generating reply information to the user input information based on the determined category of user input information comprises:
in response to determining that the determined user input information category is a target user input information category in the set of user input information categories, inputting the user input information to a reply information generation model pre-trained for the target user input information category, generating reply information for the user input information.
4. The method of claim 1, wherein said inputting the user input information into a pre-trained classification model to determine a user input information category to which the user input information belongs from a pre-determined set of user input information categories comprises:
inputting the user input information into a pre-trained classification model to obtain a value for representing emotion of a user inputting the user input information, wherein the value for representing emotion is used for representing emotion of the user inputting the user input information;
and determining the user input information category to which the user input information belongs from a predetermined user input information category set according to the magnitude relation between the value for representing the emotion and a threshold value in a preset threshold value set.
5. The method of claim 4, wherein prior to said obtaining user input information entered by a user, the method further comprises:
and in response to the fact that a new user input information category set is obtained after a preset number of user input information categories are added to a predetermined user input information category set, adding the preset number of thresholds to a preset threshold set to obtain a new threshold set.
6. The method of claim 5, wherein determining the user input information category to which the user input information belongs from a predetermined set of user input information categories according to the magnitude relationship between the value for characterizing emotion and a threshold value in a preset set of threshold values comprises:
and determining the user input information category to which the user input information belongs from the new user input information category set according to the magnitude relation between the value for representing the emotion and the threshold value in the new threshold value set.
7. The method of one of claims 1-6, wherein the number of user input information categories in the set of user input information categories is greater than three.
8. An apparatus for generating information, comprising:
an acquisition unit configured to acquire user input information input by a user;
an input unit configured to input the user input information to a pre-trained classification model to determine a user input information category to which the user input information belongs from a pre-determined set of user input information categories;
a generating unit configured to generate reply information for the user input information based on the determined user input information category.
9. The apparatus of claim 8, wherein the generating unit comprises:
a selection module configured to select information from a set of information predetermined for a target user input information category as reply information for the user input information in response to determining that the determined user input information category is the target user input information category in the set of user input information categories.
10. The apparatus of claim 8, wherein the generating unit comprises:
a generation module configured to, in response to determining that the determined user input information category is a target user input information category of the set of user input information categories, input the user input information to a reply information generation model pre-trained for the target user input information category, generate reply information for the user input information.
11. The apparatus of claim 8, wherein the input unit comprises:
an input module configured to input the user input information into a pre-trained classification model, and obtain a value for characterizing emotion of a user inputting the user input information, wherein the value for characterizing emotion is used for characterizing emotion of the user inputting the user input information;
the first determining module is configured to determine a user input information category to which the user input information belongs from a predetermined user input information category set according to the magnitude relation between the value for representing emotion and a threshold value in a preset threshold value set.
12. The apparatus of claim 11, wherein the apparatus further comprises:
the adding unit is configured to respond to a situation that a new user input information category set is obtained after a preset number of user input information categories are determined to be added to a predetermined user input information category set, and a new threshold set is obtained by adding the preset number of thresholds to the preset threshold set.
13. The apparatus of claim 12, wherein the input unit comprises:
a second determining module configured to determine a user input information category to which the user input information belongs from the new set of user input information categories according to a magnitude relationship between the value for characterizing emotion and a threshold value in the new set of threshold values.
14. The apparatus of one of claims 8-13, wherein the number of user input information categories in the set of user input information categories is greater than three.
15. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN201811508447.4A 2018-12-11 2018-12-11 Method and apparatus for generating information Pending CN111310882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811508447.4A CN111310882A (en) 2018-12-11 2018-12-11 Method and apparatus for generating information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811508447.4A CN111310882A (en) 2018-12-11 2018-12-11 Method and apparatus for generating information

Publications (1)

Publication Number Publication Date
CN111310882A true CN111310882A (en) 2020-06-19

Family

ID=71147995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811508447.4A Pending CN111310882A (en) 2018-12-11 2018-12-11 Method and apparatus for generating information

Country Status (1)

Country Link
CN (1) CN111310882A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102326144A (en) * 2008-12-12 2012-01-18 阿迪吉欧有限责任公司 The information that the usability interest worlds are confirmed is offered suggestions
CN104933157A (en) * 2015-06-26 2015-09-23 百度在线网络技术(北京)有限公司 Method and device used for obtaining user attribute information, and server
CN105701088A (en) * 2016-02-26 2016-06-22 北京京东尚科信息技术有限公司 Method and device for switching machine conversation to artificial conversation
CN108076154A (en) * 2017-12-21 2018-05-25 广东欧珀移动通信有限公司 Application message recommends method, apparatus and storage medium and server
CN108197115A (en) * 2018-01-26 2018-06-22 上海智臻智能网络科技股份有限公司 Intelligent interactive method, device, computer equipment and computer readable storage medium
CN108920510A (en) * 2018-05-30 2018-11-30 出门问问信息科技有限公司 Automatic chatting method, device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102326144A (en) * 2008-12-12 2012-01-18 阿迪吉欧有限责任公司 The information that the usability interest worlds are confirmed is offered suggestions
CN104933157A (en) * 2015-06-26 2015-09-23 百度在线网络技术(北京)有限公司 Method and device used for obtaining user attribute information, and server
CN105701088A (en) * 2016-02-26 2016-06-22 北京京东尚科信息技术有限公司 Method and device for switching machine conversation to artificial conversation
CN108076154A (en) * 2017-12-21 2018-05-25 广东欧珀移动通信有限公司 Application message recommends method, apparatus and storage medium and server
CN108197115A (en) * 2018-01-26 2018-06-22 上海智臻智能网络科技股份有限公司 Intelligent interactive method, device, computer equipment and computer readable storage medium
CN108920510A (en) * 2018-05-30 2018-11-30 出门问问信息科技有限公司 Automatic chatting method, device and electronic equipment

Similar Documents

Publication Publication Date Title
CN109460513B (en) Method and apparatus for generating click rate prediction model
CN109325121B (en) Method and device for determining keywords of text
CN111428010B (en) Man-machine intelligent question-answering method and device
CN110929799B (en) Method, electronic device, and computer-readable medium for detecting abnormal user
CN108121699B (en) Method and apparatus for outputting information
CN109359194B (en) Method and apparatus for predicting information categories
US10067935B2 (en) Prediction and optimized prevention of bullying and other counterproductive interactions in live and virtual meeting contexts
CN110555451A (en) information identification method and device
CN111159220B (en) Method and apparatus for outputting structured query statement
CN109190123B (en) Method and apparatus for outputting information
CN112733042A (en) Recommendation information generation method, related device and computer program product
CN111427974A (en) Data quality evaluation management method and device
CN110659657A (en) Method and device for training model
CN111563163A (en) Text classification model generation method and device and data standardization method and device
CN113435859A (en) Letter processing method and device, electronic equipment and computer readable medium
CN111190967B (en) User multidimensional data processing method and device and electronic equipment
CN110059172B (en) Method and device for recommending answers based on natural language understanding
CN111225009A (en) Method and apparatus for generating information
CN115801980A (en) Video generation method and device
CN110472055B (en) Method and device for marking data
CN111310882A (en) Method and apparatus for generating information
CN113111897A (en) Alarm receiving and warning condition type determining method and device based on support vector machine
CN111274383B (en) Object classifying method and device applied to quotation
CN112131379A (en) Method, device, electronic equipment and storage medium for identifying problem category
CN112131484A (en) Multi-person session establishing method, device, equipment and storage medium

Legal Events

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