CN117216619A - Training of message classification model, message recommendation method, device, medium and equipment - Google Patents

Training of message classification model, message recommendation method, device, medium and equipment Download PDF

Info

Publication number
CN117216619A
CN117216619A CN202310757901.4A CN202310757901A CN117216619A CN 117216619 A CN117216619 A CN 117216619A CN 202310757901 A CN202310757901 A CN 202310757901A CN 117216619 A CN117216619 A CN 117216619A
Authority
CN
China
Prior art keywords
classification
message
target
information
sample
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
CN202310757901.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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310757901.4A priority Critical patent/CN117216619A/en
Publication of CN117216619A publication Critical patent/CN117216619A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the invention discloses a method, a device, a medium and equipment for training and recommending a message classification model, which are applied to the technical field of information processing. Sample characteristic information of each sample message is obtained through a characteristic input module in a determined message classification initial model, the sample characteristic information is converted into a multi-target combination classification space through a prediction characteristic module, converted characteristic information is formed, then multi-target combination classification information of the sample message is output through a first prediction module according to the converted characteristic information, any multi-target combination classification comprises a plurality of first target classifications, and then the message classification initial model is trained according to the multi-target combination classification information and target classification labels. The message classification model obtained through training can directly obtain multi-target combination classification to which each message belongs according to the related attribute information of the message, so that the structure of the message classification model is simplified, and the multi-target combination classification information is more in line with the actual application situation and is more accurate.

Description

Training of message classification model, message recommendation method, device, medium and equipment
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method, an apparatus, a medium and a device for training and recommending a message classification model.
Background
The recommendation system can be generally divided into a recall stage, a coarse ranking stage, a fine ranking stage and the like in terms of flow, wherein the recall stage is generally provided with a plurality of models or strategies, and thousands of related messages can be rapidly screened from millions of candidate messages (items) and provided for the coarse ranking to perform unified pre-ranking. And screening hundreds of candidate messages from thousands of recalled messages in the coarse ranking stage, and outputting the candidate messages to the fine ranking stage. In the fine ranking stage, hundreds of candidate messages screened by coarse ranking are generally ranked more accurately, tens of messages are output and sent to a rearrangement layer or a policy layer for processing, and then a plurality of messages are sent to a user side.
In the process of recall, coarse ranking and fine ranking, a recommendation system generally needs to balance a plurality of service indexes at the same time, predicts a plurality of service indexes of each candidate message, screens the message to be recommended according to the plurality of service indexes, generally adopts a two-class model at present, respectively predicts the plurality of service indexes of each candidate message, combines the obtained plurality of service indexes to obtain an overall service index of the candidate message, and further determines whether the candidate message needs to be recommended according to the overall service index.
Therefore, if the considered business indexes are more, more classification models are needed for respective estimation, so that the overall recommendation system has a more complex structure and is easy to make mistakes.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a medium and equipment for training and recommending a message classification model, which simplify the training structure of the message classification model.
In one aspect, the embodiment of the invention provides a training method of a message classification model, which comprises the following steps:
determining a message classification initial model, wherein the message classification initial model comprises a feature input module, a prediction feature module and a first prediction module;
determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages;
for any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications;
And training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain a message classification model.
Another aspect of the embodiment of the present invention provides a message recommendation method, including:
acquiring the related attribute information of the candidate message;
acquiring candidate characteristic information of the candidate message according to the related attribute information of the candidate message;
converting the candidate feature information into feature information of a multi-target combined classification space to obtain converted feature information; the dimension of the multi-target combined classification space is m n N is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values of each of the first target classifications;
determining a multi-objective combination classification to which the candidate message belongs according to the converted characteristic information, wherein the multi-objective combination classification comprises a plurality of first objective classifications;
and carrying out message recommendation for the user terminal according to the determined multi-objective combination classification.
Another aspect of the embodiment of the present invention provides a training device for a message classification model, including:
The system comprises a model determining unit, a message classifying unit and a message classifying unit, wherein the model determining unit is used for determining a message classifying initial model, and the message classifying initial model comprises a characteristic input module, a predicting characteristic module and a first predicting module;
the sample determining unit is used for determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages;
the classification unit is used for aiming at any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications;
the model training unit is used for training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain a message classification model.
Another aspect of the embodiment of the present invention provides a message recommendation device, including:
an attribute acquisition unit for acquiring related attribute information of the candidate message;
the feature acquisition unit is used for acquiring candidate feature information of the candidate message according to the related attribute information of the candidate message;
the conversion unit is used for converting the candidate characteristic information into characteristic information of the multi-objective combined classification space to obtain converted characteristic information; the dimension of the multi-target combined classification space is m n N is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values of each of the first target classifications;
a classification unit, configured to determine, according to the converted feature information, a multi-objective combination classification to which the candidate message belongs, where the multi-objective combination classification includes a plurality of first objective classifications;
and the recommending unit is used for recommending the message for the user terminal according to the determined multi-objective combination classification.
Another aspect of the embodiments of the present invention also provides a computer readable storage medium storing a plurality of computer programs adapted to be loaded by a processor and to perform the training method of the message classification model according to the one aspect of the embodiments of the present invention, or to perform the message recommendation method according to the another aspect of the embodiments of the present invention.
In another aspect, the embodiment of the invention further provides a terminal device, which comprises a processor and a memory;
the memory is used for storing a plurality of computer programs, and the computer programs are used for loading and executing a training method of the message classification model according to one aspect of the embodiment of the invention or executing a message recommending method according to another aspect of the embodiment; the processor is configured to implement each of the plurality of computer programs.
It can be seen that, in the method of this embodiment, when the training system of the message classification model trains the message classification model, the sample feature information of each sample message is obtained through the feature input module in the determined message classification initial model, and the sample feature information is converted into the multi-target combined classification space by the prediction feature module, so as to form converted feature information, and further, the first prediction module outputs probability information that the sample message respectively belongs to at least one multi-target combined classification according to the converted feature information, wherein any multi-target combined classification comprises a plurality of first target classifications, and then the message classification initial model is trained according to the multi-target combined classification information and the target classification labels. The message classification model obtained through training can directly obtain multi-target combined classification to which each message belongs according to the related attribute information of the message, only sample characteristic information is needed to be spatially converted in the process, each target classification is not needed to be determined according to various classification modules, and the structure of the message classification model is simplified; according to the converted characteristic information obtained by space conversion, the message classification model in the embodiment can directly output information of a plurality of first target classifications of any message belonging to a multi-target combination classification at the same time, and the plurality of first target classifications are not considered separately, but the association and influence among the values of the plurality of first target classifications are comprehensively considered, so that the obtained multi-target combination classification information is more consistent with the condition of practical application and is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a schematic diagram of a training method of a message classification model according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for training a message classification model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the structure of a message classification model in one embodiment of the invention;
FIG. 4 is a flow chart of a message recommendation method according to another embodiment of the present invention;
FIG. 5 is a flow chart of a method of training a message classification model provided in one application embodiment of the invention;
FIG. 6 is a schematic diagram of a message classification model in an application embodiment of the invention;
FIG. 7 is a schematic illustration of an application host interface in an application embodiment of the invention;
FIG. 8 is a schematic diagram of a logic structure of a training system for a message classification model according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a logic structure of a message recommendation system according to an embodiment of the present invention;
fig. 10 is a schematic logic structure diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the invention provides a training method of a message classification model, which is mainly used for training the message classification model, and further, the trained message classification model is applied to a process of recommending messages, and specifically, as shown in fig. 1, the training of the message classification model can be realized by the following method:
determining a message classification initial model, wherein the message classification initial model comprises a feature input module, a prediction feature module and a first prediction module; determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages; for any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications; and training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain a message classification model.
The above trained message classification model is an artificial intelligence based machine learning model, wherein artificial intelligence (Artificial Intelligence, AI) is a theory, method, technique and application system that uses a digital computer or a digital computer controlled machine to simulate, extend and expand human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning, deep learning and other directions.
Machine Learning (ML) is a multi-domain interdisciplinary, and involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
The message classification model obtained through training can directly obtain multi-target combined classification to which each message belongs according to the related attribute information of the message, only sample characteristic information is needed to be spatially converted in the process, each target classification is not needed to be determined according to various classification modules, and the structure of the message classification model is simplified; according to the converted characteristic information obtained by space conversion, the message classification model in the embodiment can directly output information of a plurality of first target classifications of any message belonging to a multi-target combination classification at the same time, and the plurality of first target classifications are not considered separately, but the association and influence among the values of the plurality of first target classifications are comprehensively considered, so that the obtained multi-target combination classification information is more consistent with the condition of practical application and is more accurate.
The embodiment of the invention provides a training method of a message classification model, which is mainly executed by a training system of the message classification model, and a flow chart is shown in fig. 2, and comprises the following steps:
step 101, determining a message classification initial model, wherein the message classification initial model comprises a feature input module, a prediction feature module and a first prediction module.
It can be understood that when determining the initial message classification model, the training system of the message classification model determines initial values of the multi-layer structure and parameters in each layer of mechanism included in the initial message classification model, where the parameters of the initial message classification model refer to parameters that are used in the calculation process of each layer of structure in the trained message classification model and do not need to be assigned at any time, such as parameters including parameter scale, network layer number, weight value, and the like.
As shown in particular in fig. 3, the message classification initial model may include: a feature input module 10, a predicted feature module 11, and a first prediction module 12, wherein: the feature input module 10 is used for acquiring sample feature information according to the related attribute information of the sample message; the prediction feature module 11 is configured to convert the sample feature information obtained by the feature input module 10 into feature information of a multi-objective combined classification space, so as to obtain converted feature information; the first prediction module 12 is configured to output multi-objective combined classification information of the sample message according to the converted feature information obtained by the prediction feature module 11, where the multi-objective combined classification information includes probability information that the sample message belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications.
Specifically, the first prediction module 12 may output multiple classification probabilities of the sample message, where each classification probability is a probability that the sample message belongs to a multi-target combined classification, and if the classification probability is greater than a certain preset value, the sample message simultaneously belongs to multiple first target classifications under the multi-target combined classification; if the classification probability is not greater than a certain preset value, the sample message does not belong to a plurality of first target classifications under the multi-target combined classification at the same time.
Here, any one of the first object classifications may be a type obtained by dividing the sample message based on any one of object dimensions, and the object dimensions may be attribute information related to the sample message, for example, the object dimensions may be service indexes involved in determining whether any message needs to be recommended to the application terminal, such as a user click rate, a user praise rate, and the like.
Wherein the multi-objective combined classification space refers to a vector space related to multi-objective combined classification, and if the multi-objective combined classification includes n first objective classifications, each first objective classification may respectively relate to m classification values, so that the n first objective classifications of the respective classification values may be combined to form m n Multiple speciesThe dimension of the multi-target combination classification space is m n . The prediction feature module 11 mainly converts the sample feature information into a dimension m n Is described.
For example, the multi-objective combined classification includes 2 first objective classifications: a and B, each first object class having two class values, namely 0 and 1, the two first object classes of the respective class values combining to form 2 2 =4 different combinations, i.e. a=0, b=0; a=0, b=1; a=1, b=0; a=1, b=1, then the dimension of the multi-objective combined classification space is 4.
Step 102, determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages.
The sample message may be any multimedia message, such as a news message, a video message, or an audio message. The relevant attribute information of the sample message refers to information related to the sample message, and may specifically include, but is not limited to, the following information: attribute information of the sample message itself, such as identification information of the sample message; the user is based on the operation information of the sample message, such as exposure, clicking, comment, forwarding and other operations, and the user information of related operations and the like; context information (context) related to the sample message, such as current time information, etc.
The multiple target classification labels of the sample message are used for describing which first target classifications the sample message belongs to, where any target classification may be a classification related to any business index, for example, one business index is a comment of a user on the sample message, and the related target classification may be a classification whether the sample message will be commented by the user or not.
In a specific embodiment, the plurality of object classification labels for each sample message are specifically: length m n For each sample message, the annotation vector of the sample message comprising at least one target element, each target element being for indicating a multi-target combined class to which the sample message belongs, the target element being located in the annotation vector at a rootDetermined from the classification values of each first target classification in the multi-target combined classification indicated by the target element. Specifically, if the classification value of each first target classification in a multi-target group classification indicated by the target element is a binary value, the binary value formed by the classification values of each first target classification is converted into a decimal value, and the position of the target element in the labeling vector is determined according to the decimal value, for example, the converted decimal value is directly added with 1 to be used as the position of the target element. Where n is the number of first target classifications included in the multi-target combined classification and m is the number of classification values for each first target classification.
For example, two first object classifications included in a multi-object combination classification: a and B, each of the first object classes having two class values, namely 0 and 1, wherein the class values of the first object classes a and B are represented by binary digits, and the class values of the first object classes included in each of the multi-object combination classes are combined and converted to decimal numbers, and the decimal numbers corresponding to the 4 combinations are {0,1,2,3}.
If a multi-objective combination classification of a sample message is { a=0, b=1 }, its multi-objective combination classification can be expressed as a labeling vector as follows: y= {0,1, 0}, that is, in the labeling vector, the element 1 arranged at the 2 nd position is used to indicate that the corresponding sample message belongs to the multi-objective combination classification, and since the position of the element 1 is determined by the classification value of each first objective classification in the multi-objective combination classification, the classification value of each first objective classification included in the multi-objective combination classification, that is { a=0, b=1 }, can be obtained according to the position of the element 1. Element 1 is the target element.
Step 103, for any piece of sample information, obtaining sample characteristic information of the sample information according to the relevant attribute information of the sample information through a characteristic input module 10, converting the sample characteristic information into characteristic information of a multi-target combined classification space through a prediction characteristic module 11, and obtaining converted characteristic information; the multi-objective combined classification information of the sample message is output by the first prediction module 12 according to the converted feature information, the multi-objective combined classification information comprising probability information that the sample message belongs to at least one multi-objective combined classification, respectively, any of the multi-objective combined classifications comprising a plurality of first objective classifications.
And 104, training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample messages to obtain a message classification model.
Specifically, the training system of the message classification model calculates a first loss function related to the message classification initial model according to the result obtained by the message classification initial model in the step 103 and the multiple target classification labels in the training sample, where the first loss function is used to indicate the multiple target combination classification information of each sample message obtained by the message classification initial model, and errors of multiple actual target classifications (obtained according to the multiple target classification labels) of each sample message, such as cross entropy loss functions, and so on.
The training process of the message classification model is to minimize the error value, and the training process is to continuously optimize the parameter value of the parameter in the message classification initial model determined in the step 101 through a series of mathematical optimization means such as back propagation derivative and gradient descent, and minimize the calculated value of the first loss function.
It should be noted that, the steps 103 to 104 are multiple-objective combined classification information of each sample message obtained by the message classification initial model, and the parameter values in the message classification initial model need to be adjusted once, and in practical application, the steps 103 to 104 are required to be performed continuously and circularly until the adjustment of the parameter values meets a certain stop condition.
Therefore, after steps 101 to 104 of the foregoing embodiment are executed, the training system of the message classification model needs to determine whether the current adjustment of the parameter value meets a preset stopping condition, and when the current adjustment of the parameter value meets the preset stopping condition, the process is ended, and the message classification initial model adjusted in step 104 is used as the message classification model obtained by the final training; when the parameter values are not satisfied, the steps 102 to 104 are performed back for the message classification initial model after the parameter values are adjusted, that is, another training sample is replaced, and the parameter values in the message classification initial model are adjusted by using the another training sample, so as to train the message classification model. Wherein the preset stop conditions include, but are not limited to, any one of the following conditions: the difference between the current adjusted parameter value and the last adjusted parameter value is smaller than a threshold value, namely the adjusted parameter value reaches convergence; and the number of times of adjustment of the parameter value is equal to a preset number of times, etc.
It should be further noted that, the message classification model trained in the foregoing steps 101 to 104 is mainly used for obtaining multi-objective combined classification information of any message, and in practical applications, only part of the objective classifications in the multi-objective classifications may need to be considered, that is, a single objective classification or less objective classifications of the message may be considered, so in a specific embodiment, the message classification initial model determined in the foregoing step 101 may further include a second prediction module 13, configured to obtain sub-objective combined classification information according to the multi-objective combined classification information obtained by the first prediction module 13, where the sub-objective combined classification information includes probability information that the sample message belongs to the sub-objective combined classification, and the sub-objective combined classification includes at least one first objective classification described above, where the number of at least one first objective classification in the sub-objective combined classification is smaller than the number of first objective classifications in the multi-objective combined classification.
If the multi-objective combination classification information output by the first prediction module 12 includes classification probabilities corresponding to multiple multi-objective combination classifications, the second prediction module 13 determines, when acquiring the sub-objective combination classification information according to the multi-objective combination classification information, specifically, at least one multi-objective combination classification that a classification value of at least one first objective classification meets a preset value in the multiple multi-objective combination classifications, and then determines, according to the classification probabilities corresponding to the at least one multi-objective combination classification, a classification probability of the sub-objective combination classification, for example, an addition value of the classification probabilities is used as a classification probability of the sub-objective combination classification.
For example, M multi-objective combination classifications M1, M2, … …, mM, each of which includes N first objective classifications A, B, … …, N, and the classification value of each of the M multi-objective combination classifications includes: m1{ a1, B1, … …, n1}, M2{ a2, B2, … …, n2}, … …, mM { aM, bM, … …, nM }, respectively, the corresponding classification probabilities are p1, p2, … …, pM, if the second prediction module 13 needs to obtain the classification probabilities of the sample message belonging to the sub-target combination classification consisting of some of the first target classifications, for example, the classification probabilities of the sub-target combination classifications of the sample message belonging to the target classifications B and C, the classification values of which are respectively a certain specific value, specifically, the classification probabilities of the sub-target combination classifications can be obtained by finding out at least one multi-target combination classification of the target classifications B and C, respectively, of which the classification values are respectively a certain specific value, from the above M multi-target combination classifications, and adding the classification probabilities of the multi-target combination classifications.
In a specific embodiment, the classification value of the first target classification included in each multi-target combined classification message classification corresponds to a multi-bit binary value, and when determining at least one multi-target combined classification from multiple multi-target combined classifications, the training system of the message classification model shifts the corresponding multi-bit binary value at least once to the right for any multi-target combined classification in the multiple multi-target combined classifications, so as to obtain at least one shifted multi-bit binary value; converting at least one shifted multi-bit binary value into decimal values respectively to obtain at least one decimal value corresponding to any multi-target combination classification; from the multiple multi-objective combination classifications, determining that at least one decimal value respectively meets the corresponding preset value. Wherein the shift for each multi-bit binary value is the same number of bits.
For example, in the above M multi-objective combination classifications, the classification values of the first plurality of objective classifications in each multi-objective combination classification form a multi-bit binary value, the multi-bit binary value corresponding to each multi-objective combination classification is shifted to the right by i bits and j bits to obtain two shifted multi-bit binary values, the two shifted multi-bit binary values are respectively converted into decimal values, the decimal value obtained by shifting the i bits to the right is selected to be an odd number, the decimal value obtained by shifting the j bits to the right is an even number, and the corresponding multi-objective combination classification is at least one.
In this case, as shown in fig. 3, after the first prediction module 12 outputs the multi-objective combination classification information in the above step 103, the sub-objective combination classification information may further be output through the second prediction module 13, and accordingly, when the above step 104 is performed, specifically:
besides calculating a first loss function related to the initial message classification model according to the multi-target combination classification information of the sample message and the multiple target classification labels of the corresponding sample message, a second loss function related to the initial message classification model can be calculated according to the sub-target combination classification information of the sample message and at least one target classification label of the corresponding sample message, and then parameter values in the initial message classification model are adjusted according to the first loss function and the second loss function so as to obtain the training obtained message classification model.
Wherein the first loss function is mainly a loss function related to the feature input module 10, the predicted feature module 11 and the first prediction module 12 in the initial model of message classification, and the second loss function is mainly a loss function related to the feature input module 10, the predicted feature module 11, the first prediction module 12 and the second prediction module 13 in the initial model of message classification. When adjusting the parameter values in the initial model of message classification based on the first and second loss functions, an overall loss function may be obtained based on the first and second loss functions, e.g., a weighted sum of the first and second loss functions is used as the overall loss function, and the parameter values in the initial model of message classification are adjusted based on the overall loss function.
In this case, the training process of the message classification model is to minimize the value of the overall loss function, and the training process is to continuously optimize the parameter values of the parameters in the message classification initial model determined in the step 101 through a series of mathematical optimization means such as back propagation derivative and gradient descent, so as to minimize the calculated value of the overall loss function.
Alternatively, in other embodiments, the training system of the message classification model may not need to use a combination of the first loss function and the second loss function to adjust the message classification initial model when performing the step 104, but only adjusts the parameter values in the message classification initial model by the second loss function, which is not described herein.
It can be seen that, in the method of this embodiment, when the training system of the message classification model trains the message classification model, the sample feature information of each sample message is obtained through the feature input module in the determined message classification initial model, and the sample feature information is converted into the multi-target combined classification space by the prediction feature module, so as to form converted feature information, and further, the first prediction module outputs probability information that the sample message respectively belongs to at least one multi-target combined classification according to the converted feature information, wherein any multi-target combined classification comprises a plurality of first target classifications, and then the message classification initial model is trained according to the multi-target combined classification information and the target classification labels. The message classification model obtained through training can directly obtain multi-target combined classification to which each message belongs according to the related attribute information of the message, only sample characteristic information is needed to be spatially converted in the process, each target classification is not needed to be determined according to various classification modules, and the structure of the message classification model is simplified; according to the converted characteristic information obtained by space conversion, the message classification model in the embodiment can directly output information of a plurality of first target classifications of any message belonging to a multi-target component classification at the same time, and the plurality of first target classifications are not considered separately, but the correlation and influence among the values of the plurality of first target classifications are comprehensively considered, so that the obtained multi-target combined classification information is more consistent with the condition of practical application and is more accurate.
Another embodiment of the present invention further provides a message recommending method, which mainly applies the message classification model obtained by training in the foregoing embodiment to a process of recommending a message, as shown in fig. 4, where the message recommending system may implement recommendation of a message according to the following steps:
step 201, obtaining the related attribute information of the candidate message.
The candidate message may be any multimedia message such as a news message, a video message, or an audio message. The relevant attribute information of the candidate message refers to information related to the candidate message, and may specifically include, but is not limited to, the following information: attribute information of the candidate message itself, such as identification information of the candidate message; the user is based on the operation information of the candidate message, such as exposure, clicking, comment, forwarding and other operations, and the user information of related operations and the like; context information (context) associated with the candidate message, such as current time information, etc.
Step 202, obtaining candidate characteristic information of the candidate message according to the related attribute information of the candidate message.
Step 203, converting the candidate feature information into feature information of a multi-objective combined classification space, to obtain converted feature information, wherein the dimension of the multi-objective combined classification space is m n N is the number of first object classifications included in the multi-object combined classification and m is the number of classification values for each first object classification.
In particular, the candidate feature information may be converted into a dimension m n Is described.
Step 204, determining a multi-objective combination classification to which the candidate message belongs according to the converted feature information, wherein the multi-objective combination classification comprises a plurality of first objective classifications.
And step 205, recommending the message to the user terminal according to the determined multi-objective combination classification.
Specifically, whether the candidate message needs to be recommended to the user terminal may be determined according to the determined multi-objective combination classification, each candidate message may be ordered according to the multi-objective combination classification to which the candidate message belongs, and the plurality of candidate messages ranked at the front may be recommended to the user terminal.
In a specific embodiment, the steps 202 to 204 are mainly performed by a pre-trained message classification model, so that after the step 201 is performed, the pre-trained message classification model needs to be called, and the steps 202 to 204 are performed by the called message classification model, that is, the steps of obtaining candidate feature information, obtaining converted feature information and determining multi-objective combination classification are performed by the message classification model.
The training may be performed according to the method shown in the foregoing embodiment when training the message classification model, which is not described herein.
Further, when executing the step 205, the message recommendation system may first obtain, according to the multi-objective combination classification information, a sub-objective combination classification to which the candidate message belongs, where the sub-objective combination classification includes at least one first objective classification, and the number of at least one first objective classification in the sub-objective combination classification is smaller than the number of first objective classifications in the multi-objective combination classification, so as to recommend the message to the user terminal according to the determined sub-objective combination classification.
Therefore, as the trained message classification model can directly output any message simultaneously belonging to the information of a plurality of first target classifications under one target combination classification according to the converted characteristic information obtained by space conversion, the plurality of first target classifications are not considered separately, but the association and influence among the values of the plurality of first target classifications are comprehensively considered, so that the obtained multi-target combination classification information is more in line with the actual application condition, is more accurate, and is further more accurate in recommending the message to the application terminal.
The following describes a message recommendation method according to the present invention with a specific application example, in this embodiment, a trained message classification model is mainly applied to a video message recommendation system, and specifically, the method in this embodiment may include the following two parts:
as shown in fig. 5, the message classification model may be trained as follows, including:
in step 301, a message classification initial model is determined, the message classification initial model including a feature input module, a predicted feature module, a first prediction module, and a second prediction module.
As shown in fig. 6, the feature input modules in the initial message classification model are specifically an Embedding layer (Embedding), a splicing layer (splicing) and a neural network layer (Deep Neural Network, DNN), wherein the Embedding layer maps the relevant attribute information of each sample message into feature vectors to obtain N feature line vectors, and for the nth feature, the N feature is denoted as x n Dimension d n The N feature vectors are spliced by the splicing layer to obtain an input vector X, as shown in the following formula 1:
X=[...,x n ,...] T (1)
wherein the dimension of the column vector X isAfter the input vector X is processed by DNN, a higher-order expression vector of the sample message is obtained, which can be specifically shown in the following formula 2, wherein h (·) represents the processing procedure of DNN, and the dimension of vector v is denoted as d v
v=h(X) (2)
After some relevant attribute information of the sample message passes through the embedding layer, the feature vector with an indefinite length is converted into a feature vector with a definite length through a Pooling layer (Pooling).
Further, the prediction feature module in the initial model of message classification is specifically configured to transform the high-order expression vector, for example, if the multi-objective combined classification includes T first objective classifications, and the classification value of each first objective classification has 2 (i.e. 0 and 1), the prediction feature module may be represented by a dot product operation according to the following formula 3, so as to obtain the transformed feature information s:
s=Z·v (3)
wherein the dimension of the matrix Z is 2 T ×d v S is a dimension of 2 T The converted feature information s can further pass through the first prediction module to obtain classification probabilities p of the sample message belonging to multiple multi-objective combination classifications respectively, which can be expressed by the following formula 4:
it should be noted that, after the first prediction module outputs the classification probabilities p that the sample message belongs to multiple multi-objective combination classifications, each multi-objective combination classification includes T first objective classifications, and further, the second prediction module may restore the classification probabilities that the sample message belongs to sub-objective combination classifications from these classification probabilities p, where at least one of the above first objective classifications is included, for example, the i-th and the j-th first objective classifications in the T first objective classifications, and the classification value of the i-th first objective classification needs to be 1, i.e. q i =1, and the j-th first target class has a class value of 0, i.e. q j Classification probability of sub-target combination classification formed by combination=0, specifically:
if the classification value of the first target classification included in each multi-target combination classification corresponds to one multi-bit binary value, the multi-bit binary value corresponding to each multi-target combination classification can be shifted to the right by i and j bits respectively to obtain a multi-bit binary value shifted to the right by i bits and a multi-bit binary value shifted to the right by j bits respectively, the two multi-bit binary values are converted into decimal values respectively to obtain two decimal values, the two decimal values are selected to respectively satisfy the multi-target combination classification of the corresponding preset value, namely the decimal value shifted to the right by i bits is odd, and the decimal value shifted to the right by j bits is even, namely q is met i =1, and q j =0, and adding the classification probabilities of the selected multi-objective combination classifications to obtain the classification probability that the sample message belongs to the sub-objective combination classification. Specifically, the expression can be expressed by the following formula 5:
where > represents a bit operation, representing a remainder to 2, M is the number of multiple multi-objective combination classifications.
Step 302, determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of each sample message.
In a specific embodiment, it is assumed that T first target classifications are included in the multi-target combined classification, each first target classification may have 2 classification values of 0 or 1, and for the T first target classification, the classification value is q t For a certain sample message, the classification values of the T first target classifications can be spliced into a multi-bit binary value consisting of 0 and 1, and the multi-bit binary value can be used as a representation of a T-bit binary value converted by a decimal value m, and can be specifically represented by the following formula 6:
binary T (m)=[...,q t ,...] (6)
wherein, [.]Represents the splicing operation, and the value range of m is [0,2 T -1],binary T (. Cndot.) means that a decimal value is converted into a T-bit binary value, and a plurality of object class labels of the sample message can be marked as a length of 2 T Is only given a value of 1 at position m, i.e. Y m The decimal value corresponding to all possible combinations of the classification values of the multi-objective combination classification is denoted as a set M.
Step 303, for each sample message, obtaining sample feature information of the sample message according to the relevant attribute information of the sample message through a feature input module, and converting the sample feature information into feature information of a multi-target combined classification space through a prediction feature module to obtain converted feature information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, the multi-objective combined classification information including probability information that the sample message includes that the sample message belongs to at least one multi-objective combined classification, any of the multi-objective combined classifications including a plurality of first objective classifications; the second prediction module acquires sub-target combination classification information of the sample message according to the multi-target combination classification information, wherein the sub-target combination classification comprises at least one first target classification.
Step 304, calculating a second loss function related to the initial message classification model according to the sub-target combination classification information of each sample message obtained by the initial message classification model and the multiple target classification labels of the corresponding sample messages, and adjusting parameter values in the initial message classification model according to the second loss function, wherein the parameter values can comprise a matrix Z shown in the formula 3.
The second loss function calculation is specifically described in the foregoing embodiments, which is not described herein, specifically, the second loss function may be represented by the following formula 7:
L=-log(p m ) (7)
step 305, judging whether the adjustment of the parameter value meets the preset stopping condition, if so, ending the flow, and taking the message classification initial model adjusted in the step 304 as the message classification model obtained by the final training; when the parameter values are not satisfied, the steps 202 to 204 are performed back for the message classification initial model after the parameter values are adjusted, that is, another training sample is replaced, and the parameter values in the message classification initial model are adjusted by using the another training sample, so as to train the message classification model.
It can be seen that the message classification model trained in this embodiment mainly integrates multiple first target classifications, and directly predicts multiple first target classifications to which messages belong simultaneously by considering the influence of each message among the multiple first target classifications, and compared with the method of respectively predicting which first target classifications a message belongs to by using multiple independent classification models, the obtained multi-target combination classification information is more accurate, and the structure of the message classification model can be simplified,
Secondly, presetting the trained message classification model into a video message recommendation system, and recommending video messages, specifically:
in the video message recommending system, a video recommending interface can be provided for a user terminal, the video recommending interface can comprise a recommending control, when the video message recommending system recommends a new video message to the video recommending interface, the recommending control can be displayed in different modes based on the type of the new video message so as to prompt a user to have the new video message of the corresponding type, so that the user can know which types of video messages are recommended by the system according to the recommending control of different display modes, and if the user is interested in the video message of the specific type, the recommending control is triggered to enter the detail interface of the new video message for displaying.
The new video message type is mainly the type obtained for the content of the new video message, and is different from the multi-objective combination classification obtained based on the related attribute information of the video message and the pre-trained message classification model.
For example, as shown in fig. 7, a small world button at the bottom of an application main interface of an instant messaging application (such as QQ) is a recommendation control, if a video message recommendation system recommends a new video message to the instant messaging application, the video message recommendation system will pop up with different types of red dots around the small world button based on the type of the new video message to prompt the user that the user has a new video message of a corresponding type, and if the user is interested in a certain type of video message, the small world button is triggered to enter a detail interface of the video message.
For video messages recommended to the user terminal, the video message recommendation system firstly screens out candidate video messages through recall, then divides each candidate video message into a plurality of types through configuration files, displays new video messages with corresponding types to prompt the user terminal in different modes, and the user terminal directly displays the new video messages in different modes. In general, as shown in fig. 7, there are mainly, but not limited to, the following types of video messages: the method comprises the steps that a friend head portrait is filled in a small world button of a social type video message, and a word similar to 'friend praise' is prompted, wherein the social type video message refers to a message that friends praise, comment or forward the video message; the dynamic content of the video message can be displayed above the small world button; the video message of the fixed document type may be displayed over the small world button.
In practical application, in the recall screening stage, the multi-objective combination classification to which each candidate video message belongs can be obtained by calling the message classification model, and then each candidate video message is ordered according to the multi-objective combination classification, and a plurality of candidate video messages arranged at the forefront are recommended to the user terminal.
Wherein the multi-objective combined classification includes a plurality of first objective classifications, and event combinations based on the plurality of first objective classifications often do not fully satisfy three relationship divisions between events in the combined probability: the mutual exclusion event, the independent event and the dependent event are complex and various in combination relation among different first target classifications, for example, different praise targets possibly have mutual exclusion to a great extent, praise can only occur once generally, praise can occur through a praise button, praise can also occur through double-click video, after one of the two praise events occurs, the other praise cannot occur, but in some cases, praise can also occur through another mode after praise cancellation, and the mutual exclusion is not absolute. For example, a video with longer playing duration is more likely to interact, but the observation of the video by groups in the dimension of age can find that the interaction of the user with shorter duration of the user with lower duration of the user with the age again, and the relationship is opposite. In summary, the relationships between the events of the multi-objective classification are complex and various, not limited to the two-by-two relationships, but also limited to the single event relationship, and the relationships of the multi-objective classification are difficult to be obtained by individually estimating the probability of each objective classification, and according to the converted characteristic information obtained by performing spatial conversion, the training message classification model in this embodiment can directly output any message and simultaneously belongs to the information of a plurality of first objective classifications under a multi-objective combination classification, and the plurality of first objective classifications are not considered separately, but comprehensively consider the association and influence between the values of the plurality of first objective classifications, so that the multi-objective combination classification can be directly predicted.
The embodiment of the invention also provides a training device of the message classification model, the structure schematic diagram of which is shown in fig. 8, and the training device specifically can comprise:
the model determining unit 20 is configured to determine a message classification initial model, where the message classification initial model includes a feature input module, a prediction feature module, and a first prediction module.
The sample determining unit 21 is configured to determine a training sample, where the training sample includes relevant attribute information corresponding to each of a plurality of sample messages, and a plurality of target classification labels of each of the plurality of sample messages.
A classification unit 22, configured to obtain, for any sample message, sample feature information of the sample message according to the relevant attribute information of the sample message determined by the sample determination unit 21 through the feature input module determined by the model determination unit 20, and convert the sample feature information into feature information of a multi-objective combined classification space through the prediction feature module, so as to obtain converted feature information; and outputting multi-target combined classification information of the sample message according to the converted characteristic information through the first prediction module, wherein the multi-target combined classification information comprises probability information that the sample message respectively belongs to at least one multi-target combined classification, and any multi-target combined classification comprises a plurality of first target classifications.
The model training unit 23 is configured to train the initial message classification model according to the multi-target combined classification information of each sample message obtained by the initial message classification model in the classification unit 22 and the multiple target classification labels of the corresponding sample message, so as to obtain a message classification model.
In a specific embodiment, in the training samples determined by the sample determining unit 21, the plurality of object classification labels of each sample message are specifically: length m n Is a labeling vector of (a); for each sample message, the labeling vector of the sample message comprises at least one target element, each target element is used for indicating a multi-target combination class to which the sample message belongs, and the position of the target element in the labeling vector is determined according to the classification value of each first target class in the multi-target combination class indicated by the target element; wherein n is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values for each of the first target classifications.
Wherein the target element is inThe position of the labeling vector is determined according to the classification value of each first target classification in the multi-target combination classification indicated by the target element, and specifically comprises the following steps: and if the classification value of each first target classification in the multi-target combined classification indicated by the target element is a binary value, converting the binary value formed by the classification values of each first target classification into a decimal value, and determining the position of the target element in the annotation vector according to the decimal value. The dimension of the multi-target combined classification space is m n In the classification unit 22, the prediction feature module converts the sample feature information into feature information of a multi-objective combined classification space, so as to obtain converted feature information, which specifically includes: the prediction feature module converts the sample feature information into a dimension m n Is described.
Further, in the training device of the message classification model of the present embodiment, the message classification initial model determined by the model determining unit 20 further includes: a second prediction module; the above-mentioned classification unit 22 is further configured to obtain sub-objective combination classification information according to the multi-objective combination classification information, where the sub-objective combination classification information includes probability information that the sample message belongs to a sub-objective combination classification, and the sub-objective combination classification includes at least one first objective classification, and a number of at least one first objective classification in the sub-objective combination classification is smaller than a number of first objective classifications in the multi-objective combination classification.
The second prediction module is specifically configured to determine, in the multiple multi-objective combination classifications, at least one multi-objective combination classification in which a classification value of at least one first objective classification meets a preset value when sub-objective combination classification information is obtained according to the multi-objective combination classification information; and determining the classification probability of the sub-target combination classification according to the classification probabilities respectively corresponding to the at least one multi-target combination classification.
Wherein the classification value of each of the plurality of first target classifications corresponds to a multi-bit binary value, and in the plurality of multi-target classifications, it is determined that the classification value of at least one first target classification corresponds to at least one multi-target combination classification with a preset value, specifically: aiming at any multi-target combination classification of multiple multi-target combination classifications, shifting the corresponding multi-bit binary number value at least once to the right to obtain at least one shifted multi-bit binary number value respectively; converting the at least one shifted multi-bit binary value into decimal values respectively to obtain at least one decimal value corresponding to any multi-target combination classification; and determining that the at least one decimal value respectively meets the multi-target combination classification with corresponding preset values from the multi-target combination classifications.
Further, the model training unit 23 is specifically configured to calculate a first loss function related to the initial model of message classification according to the multi-objective combined classification information of the sample message and the multiple objective type labels of the corresponding sample message; calculating a second loss function related to the initial message classification model according to sub-target combination classification information of the sample message and at least one target type label of the corresponding sample message; and adjusting parameter values in the message classification initial model according to the first loss function and the second loss function so as to train and obtain the message classification model.
In the training device of the message classification model of the embodiment, the message classification model obtained through training can directly obtain multi-target combination classification to which each message belongs according to the related attribute information of the message, in the process, only sample characteristic information is needed to be spatially converted, each target classification is not needed to be determined according to various classification modules, and the structure of the message classification model is simplified; according to the converted characteristic information obtained by space conversion, the message classification model in the embodiment can directly output information of a plurality of first target classifications of any message belonging to a multi-target combination classification at the same time, and the plurality of first target classifications are not considered separately, but the association and influence among the values of the plurality of first target classifications are comprehensively considered, so that the obtained multi-target combination classification information is more consistent with the condition of practical application and is more accurate.
The embodiment of the invention also provides a message recommending device, the structure schematic diagram of which is shown in fig. 9, and the device specifically can comprise:
an attribute acquiring unit 30, configured to acquire related attribute information of the candidate message.
A feature acquiring unit 31, configured to acquire candidate feature information of the candidate message according to the related attribute information of the candidate message acquired by the attribute acquiring unit 30.
A conversion unit 32, configured to convert the candidate feature information acquired by the feature acquisition unit 31 into feature information of a multi-objective combined classification space, to obtain converted feature information; the dimension of the multi-target combined classification space is m n And n is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values of each first target classification.
A classification unit 33, configured to determine, according to the converted feature information obtained by the conversion unit 32, a multi-objective combination classification to which the candidate message belongs, where the multi-objective combination classification includes a plurality of first objective classifications;
and a recommending unit 34, configured to classify and recommend the message to the user terminal according to the multi-objective combination determined by the classifying unit 33.
Further, the message recommending apparatus of the present embodiment may further include:
a calling unit 35, configured to call the pre-trained message classification model after the attribute obtaining unit 30 obtains the related attribute information; in this way, the above-described feature acquisition unit 31, conversion unit 32, and classification unit 33 perform the steps of acquiring the candidate feature information, obtaining the converted feature information, and determining the multi-objective combination classification, respectively, using the message classification model called by the calling unit 35.
Further, the message recommending apparatus of the present embodiment may further include:
a training unit 36 for determining a message classification initial model, the message classification initial model comprising a feature input module, a predicted feature module, and a first prediction module; determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages; for any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications; and training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain the message classification model.
Therefore, in the message recommendation device of this embodiment, because the trained message classification model can directly output the information of the multiple first target classifications of any message under a multi-target combined classification according to the converted feature information obtained by performing spatial conversion, the multiple first target classifications are not considered separately, but the correlation and the influence between the values of the multiple first target classifications are considered comprehensively, so that the obtained multi-target combined classification information is more consistent with the actual application situation, more accurate, and the message recommended to the application terminal.
The embodiment of the present invention further provides a terminal device, whose structure schematic diagram is shown in fig. 10, where the terminal device may generate relatively large differences due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 40 (e.g., one or more processors) and a memory 41, and one or more storage media 42 (e.g., one or more mass storage devices) storing application 421 or data 422. Wherein the memory 41 and the storage medium 42 may be transitory or persistent storage. The program stored in the storage medium 42 may include one or more modules (not shown), each of which may include a series of instruction operations in the terminal device. Still further, the central processor 40 may be arranged to communicate with a storage medium 42, and to execute a series of instruction operations in the storage medium 42 on a terminal device.
Specifically, the application 421 stored in the storage medium 42 includes an application of message classification training, and the application may include the model determining unit 20, the sample determining unit 21, the classifying unit 22, and the model training unit 23 in the training apparatus of the message classification model described above, which will not be described herein. Still further, the central processor 40 may be configured to communicate with the storage medium 42 and execute a series of operations corresponding to the application program of the message classification training stored in the storage medium 42 on the terminal device.
The terminal device may also include one or more power supplies 43, one or more wired or wireless network interfaces 44, one or more input/output interfaces 45, and/or one or more operating systems 423, such as Windows ServerTM, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The steps performed by the training means of the message classification model described in the above method embodiments may be based on the structure of the terminal device shown in fig. 10.
Further, the embodiment of the present invention also provides another terminal device, where the structure of the terminal device may be as the structure of the terminal device shown in fig. 10, and the difference is that, in the terminal device of this embodiment:
The application program stored in the storage medium includes an application program for recommending a message, and the application program may include an attribute acquiring unit 30, a feature acquiring unit 31, a converting unit 32, a classifying unit 33, a recommending unit 34, a calling unit 35, and a training unit 36 in the message recommending apparatus, which are not described herein. Still further, the central processor may be configured to communicate with the storage medium and execute a series of operations corresponding to the message-recommended application stored in the storage medium on the terminal device. The steps performed by the message recommendation system described in the above-described method embodiment may be based on the structure of the terminal device of the present embodiment.
Still further, another aspect of the embodiments of the present invention provides a computer-readable storage medium storing a plurality of computer programs adapted to be loaded by a processor and to perform a training method of a message classification model as performed by a training system of the message classification model described above, or to perform a message recommendation method as performed by the message recommendation system described above.
In another aspect, the embodiment of the invention further provides a terminal device, which comprises a processor and a memory;
The memory is used for storing a plurality of computer programs, and the computer programs are used for loading and executing a training method of the message classification model, which is executed by a training system of the message classification model, or executing a message recommending method, which is executed by the message recommending system; the processor is configured to implement each of the plurality of computer programs.
Further, according to an aspect of the present application, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the training method or the message recommendation method of the message classification model provided in the various alternative implementations described above.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
The training of the message classification model, the message recommendation method, the device, the medium and the device provided by the embodiment of the invention are described in detail, and specific examples are applied to the description of the principle and the implementation mode of the invention, and the description of the above embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (15)

1. A method for training a message classification model, comprising:
determining a message classification initial model, wherein the message classification initial model comprises a feature input module, a prediction feature module and a first prediction module;
determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages;
for any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications;
And training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain a message classification model.
2. The method of claim 1, wherein the plurality of destinations for each sample messageThe label classification label specifically comprises: length m n Is a labeling vector of (a);
for each sample message, the labeling vector of the sample message comprises at least one target element, each target element is used for indicating a multi-target combination class to which the sample message belongs, and the position of the target element in the labeling vector is determined according to the classification value of each first target class in the multi-target combination class indicated by the target element;
wherein n is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values for each of the first target classifications.
3. The method according to claim 2, wherein the location of the target element in the annotation vector is determined according to the classification value of each first target class in the multi-target combined classification indicated by the target element, specifically comprising:
If the classification value of each first target classification in the multi-target combined classification indicated by the target element is a binary value, converting the binary value formed by the classification values of each first target classification into a decimal value;
and determining the position of the target element in the annotation vector according to the decimal value.
4. The method of claim 2, wherein the multi-objective combined classification space has a dimension m n
The prediction feature module converts the sample feature information into feature information of a multi-target combined classification space to obtain converted feature information, and the method specifically comprises the following steps: the prediction feature module converts the sample feature information into a dimension m n Is described.
5. The method of any of claims 1 to 4, wherein the message classification initial model further comprises: a second prediction module; the method further comprises the steps of:
the second prediction module obtains sub-target combination classification information according to the multi-target combination classification information, wherein the sub-target combination classification information comprises probability information that the sample message belongs to sub-target combination classification, the sub-target combination classification comprises at least one first target classification, and the number of the at least one first target classification in the sub-target combination classification is smaller than that of the first target classifications in the multi-target combination classification.
6. The method of claim 5, wherein the multi-objective combined classification information includes classification probabilities corresponding to a plurality of multi-objective combined classifications, and the second prediction module obtains sub-objective combined classification information according to the multi-objective combined classification information, specifically comprising:
determining at least one multi-target combined classification of which the classification value of at least one first target classification accords with a preset value in the multiple multi-target combined classifications;
and determining the classification probability of the sub-target combination classification according to the classification probabilities respectively corresponding to the at least one multi-target combination classification.
7. The method of claim 6, wherein the classification value of the first target class included in each of the multi-target combined classifications corresponds to a multi-bit binary value, and wherein the determining at least one multi-target combined classification for which the classification value of at least one of the first target classes corresponds to a preset value among the plurality of multi-target combined classifications, specifically comprises:
aiming at any multi-target combination classification in the multi-target combination classifications, shifting the corresponding multi-bit binary number value at least once to the right to obtain at least one shifted multi-bit binary number value respectively;
Converting the at least one shifted multi-bit binary value into a decimal value respectively to obtain at least one decimal value corresponding to any multi-target combination classification;
and determining that the at least one decimal value respectively meets the multi-target combination classification with corresponding preset values from the multi-target combination classifications.
8. The method of claim 5, wherein the training the message classification initial model includes:
calculating a first loss function related to the initial message classification model according to the multi-target combination classification information of the sample message and a plurality of target type labels of the corresponding sample message;
calculating a second loss function related to the initial message classification model according to sub-target combination classification information of the sample message and at least one target type label of the corresponding sample message;
and adjusting parameter values in the message classification initial model according to the first loss function and the second loss function so as to train and obtain the message classification model.
9. A message recommendation method, comprising:
acquiring the related attribute information of the candidate message;
acquiring candidate characteristic information of the candidate message according to the related attribute information of the candidate message;
converting the candidate feature information into feature information of a multi-target combined classification space to obtain converted feature information; the dimension of the multi-target combined classification space is m n N is the number of first target classifications included in the multi-target combined classification, and m is the number of classification values of each of the first target classifications;
determining a multi-objective combination classification to which the candidate message belongs according to the converted characteristic information, wherein the multi-objective combination classification comprises a plurality of first objective classifications;
and carrying out message recommendation for the user terminal according to the determined multi-objective combination classification.
10. The method of claim 9, wherein after obtaining the related attribute information of the candidate message, further comprising: invoking a pre-trained message classification model;
and executing the steps of acquiring the candidate feature information, obtaining the converted feature information and determining the multi-objective combination classification through the message classification model.
11. The method as recited in claim 10, further comprising:
determining a message classification initial model, wherein the message classification initial model comprises a feature input module, a prediction feature module and a first prediction module;
determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages;
for any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications;
and training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain the message classification model.
12. A training device for a message classification model, comprising:
the system comprises a model determining unit, a message classifying unit and a message classifying unit, wherein the model determining unit is used for determining a message classifying initial model, and the message classifying initial model comprises a characteristic input module, a predicting characteristic module and a first predicting module;
the sample determining unit is used for determining a training sample, wherein the training sample comprises relevant attribute information corresponding to a plurality of sample messages respectively and a plurality of target classification labels of the sample messages;
the classification unit is used for aiming at any piece of sample information, acquiring sample characteristic information of the sample information according to the relevant attribute information of the sample information through the characteristic input module, and converting the sample characteristic information into characteristic information of a multi-target combined classification space through the prediction characteristic module to obtain converted characteristic information; outputting, by the first prediction module, multi-objective combined classification information of the sample message according to the converted feature information, where the multi-objective combined classification information includes probability information that the sample message respectively belongs to at least one multi-objective combined classification, and any multi-objective combined classification includes a plurality of first objective classifications;
The model training unit is used for training the message classification initial model according to the multi-target combined classification information of each sample message obtained by the message classification initial model and the multiple target classification labels of the corresponding sample message so as to obtain a message classification model.
13. A message recommendation device, comprising:
an attribute acquisition unit for acquiring related attribute information of the candidate message;
the feature acquisition unit is used for acquiring candidate feature information of the candidate message according to the related attribute information of the candidate message;
the conversion unit is used for converting the candidate characteristic information into characteristic information of the multi-objective combined classification space to obtain converted characteristic information; the dimension of the multi-target combined classification space is m n The n is the number of first target classifications included in the multi-target combined classification, and m is each first targetThe number of classification values of the classification;
a classification unit, configured to determine, according to the converted feature information, a multi-objective combination classification to which the candidate message belongs, where the multi-objective combination classification includes a plurality of first objective classifications;
and the recommending unit is used for recommending the message for the user terminal according to the determined multi-objective combination classification.
14. A computer readable storage medium storing a plurality of computer programs adapted to be loaded by a processor and to perform the training method of the message classification model according to any of claims 1 to 8 or the message recommendation method according to any of claims 9 to 11.
15. A terminal device comprising a processor and a memory;
the memory is used for storing a plurality of computer programs for loading and executing the training method of the message classification model according to any one of claims 1 to 8 or the message recommendation method according to any one of claims 9 to 11 by a processor; the processor is configured to implement each of the plurality of computer programs.
CN202310757901.4A 2023-06-25 2023-06-25 Training of message classification model, message recommendation method, device, medium and equipment Pending CN117216619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310757901.4A CN117216619A (en) 2023-06-25 2023-06-25 Training of message classification model, message recommendation method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310757901.4A CN117216619A (en) 2023-06-25 2023-06-25 Training of message classification model, message recommendation method, device, medium and equipment

Publications (1)

Publication Number Publication Date
CN117216619A true CN117216619A (en) 2023-12-12

Family

ID=89041350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310757901.4A Pending CN117216619A (en) 2023-06-25 2023-06-25 Training of message classification model, message recommendation method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN117216619A (en)

Similar Documents

Publication Publication Date Title
CN109947919B (en) Method and apparatus for generating text matching model
US10127477B2 (en) Distributed event prediction and machine learning object recognition system
CN109816032B (en) Unbiased mapping zero sample classification method and device based on generative countermeasure network
CN110555469B (en) Method and device for processing interactive sequence data
CN109145828B (en) Method and apparatus for generating video category detection model
US20230196202A1 (en) System and method for automatic building of learning machines using learning machines
US20210117718A1 (en) Entropy Based Synthetic Data Generation For Augmenting Classification System Training Data
CN109447096B (en) Glance path prediction method and device based on machine learning
CN115244587A (en) Efficient ground truth annotation
JP7020547B2 (en) Information processing equipment, control methods, and programs
CN110110372B (en) Automatic segmentation prediction method for user time sequence behavior
CN105095494A (en) Method for testing categorical data set
CN109189922B (en) Comment evaluation model training method and device
KR20210148095A (en) Data classification method and system, and classifier training method and system
CN110704668B (en) Grid-based collaborative attention VQA method and device
KR20180086021A (en) Image analyzing method based on random tree cnn and image analyzing method based on forest cnn
CN111143517A (en) Method, device, equipment and storage medium for predicting human-selected label
WO2024051707A1 (en) Recommendation model training method and apparatus, and resource recommendation method and apparatus
CN112988851A (en) Counterfactual prediction model data processing method, device, equipment and storage medium
CN117216619A (en) Training of message classification model, message recommendation method, device, medium and equipment
WO2020202594A1 (en) Learning system, method and program
JP6927409B2 (en) Information processing equipment, control methods, and programs
Mishra Fine-Tuning Deep Learning Models Using PyTorch
Titu et al. Acquiring businesss intelligence through data science: A practical approach
WO2023085195A1 (en) Model generation device, model generation method, and data estimation device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication