Session message sending method and device, storage medium and electronic equipment

By obtaining user attribute information and historical messages, and using the session generation model and recommendation model to generate personalized session messages, the problems of insufficient personalization of messages, high repetition rate and low accuracy in the prior art are solved, and more efficient conversation message sending is achieved.

CN119520455APending Publication Date: 2025-02-25HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411650757.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The sending method of existing session messages cannot generate personalized messages, the message reuse rate is high, and the inability to update rules in real time leads to low message accuracy.

Method used

By obtaining user attribute information and historical messages from the sending and receiving ends of the message, input them into the online session generation model, personalized session messages are generated, and the messages are scored and recommended based on the preset session recommendation model.

Benefits of technology

Significantly improves the personalization and accuracy of conversation messages, reduces message reuse, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520455A_ABST
    Figure CN119520455A_ABST
Patent Text Reader

Abstract

The invention provides a session message sending method and device, a storage medium and electronic equipment, and relates to the technical field of big data processing, and the method comprises the steps: obtaining first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, obtaining a first historical message of the message sending end and a second historical message of the message receiving end; inputting the first to-be-predicted user attribute information, the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an online session generation model to obtain a first session message corresponding to the message sending end; scoring the first session messages based on a preset session recommendation model to obtain a first scoring result, and determining to-be-sent session messages from the first session messages according to the first scoring result; and determining a target session message, and sending the target session message to a message receiving end. According to the invention, personalized generation of the session message is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of big data processing. More specifically, the embodiments of the present disclosure relate to a method for sending a session message, a device for sending a session message, a computer-readable storage medium, and an electronic device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In the existing method for sending conversation messages, one can select a desired message from the messages provided in the existing message templates and send it. However, this method has the following defects: on the one hand, it is impossible to generate personalized messages; on the other hand, the message reuse rate is too high. Summary of the invention

[0004] However, in the related technical solutions, on the one hand, selecting corresponding conversation messages from existing message templates has the problem of being unable to generate personalized messages and having too high a message reuse rate; on the other hand, automatically generating conversation messages based on set rules has the problem of being unable to update the rules in real time, resulting in a low accuracy of the obtained conversation messages.

[0005] Therefore, an improved method for sending a conversation message is highly desired, so as to obtain first user attribute information to be predicted at a message sending end and second user attribute information to be predicted at a message receiving end, and obtain first historical messages at the message sending end and second historical messages at the message receiving end; then the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end; then the first conversation message is scored based on a preset conversation recommendation model to obtain a first scoring result, and the conversation message to be sent is determined from the first conversation message according to the first scoring result; finally, a target conversation message is determined in response to a selection operation for the conversation message to be sent, and the target conversation message is sent to the message receiving end, so that the accuracy of the target conversation message can be improved on the basis of improving the personalization of the target conversation message.

[0006] In this context, embodiments of the present disclosure are intended to provide a method for sending a session message, an apparatus for sending a session message, a computer-readable storage medium, and an electronic device.

[0007] According to one aspect of the present disclosure, a method for sending a session message is provided, comprising:

[0008] Acquire first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end;

[0009] Inputting the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record into an online conversation generation model to obtain a first conversation message corresponding to the message sending end;

[0010] Scoring the first conversation messages based on a preset conversation recommendation model to obtain a first scoring result, and determining a conversation message to be sent from the first conversation messages according to the first scoring result;

[0011] In response to the selection operation on the to-be-sent session message, a target session message is determined, and the target session message is sent to the message receiving end.

[0012] In an exemplary embodiment of the present disclosure, the online conversation generation model includes an embedding mapping layer, an encoding layer, and a hybrid expert model layer;

[0013] The first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end, including:

[0014] Generate user basic information to be predicted according to the first user attribute information to be predicted and the second user attribute information to be predicted, and generate context information to be predicted according to the first historical message record, the second historical message record and preset model prompt parameters;

[0015] Based on the embedding mapping layer, word embedding processing is performed on the user basic information to be predicted to obtain a first user feature, and based on the embedding mapping layer, embedding mapping processing is performed on the context information to be predicted to obtain a context marker sequence;

[0016] The first user feature and the context marker sequence are encoded based on the encoding layer to obtain an overall context representation, and the context marker sequence and the overall context representation are predicted based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sender.

[0017] In an exemplary embodiment of the present disclosure, the hybrid expert model layer includes a gated network model and an expert neural network model;

[0018] The step of predicting the context marker sequence and the overall context representation based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sending end includes:

[0019] Determining a model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining a target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight;

[0020] The context marker sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sending end.

[0021] In an exemplary embodiment of the present disclosure, the gated network model includes a first gated network model and a second gated network model;

[0022] Wherein, determining the model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining the target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight, includes:

[0023] Determine, based on the first gating network model and according to the context flag sequence, a first model weight of the expert neural network model on the dimension of whether to reply to a message, and determine, from the expert neural network according to the first model weight, a first target neural network model required to perform a first conversation message prediction task on the dimension of whether to reply to a message;

[0024] Based on the second gating network model, according to the context flag sequence, the second model weight of the expert neural network model on the dimension of whether to make multiple message replies is determined, and according to the second model weight, the second target neural network model required to perform the first conversation message prediction task on the dimension of whether to make multiple message replies is determined from the expert neural network.

[0025] In an exemplary embodiment of the present disclosure, the context marker sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sending end, including:

[0026] Inputting the context marker sequence and the overall context representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message;

[0027] Inputting the context marker sequence and the overall context representation into the second target neural network model to obtain a second prediction result on the dimension of whether to make multiple message replies;

[0028] A first conversation message corresponding to the message sending end is determined according to the first prediction result and the second prediction result.

[0029] In an exemplary embodiment of the present disclosure, the context flag sequence and the overall context representation are input into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message, including:

[0030] Inputting the context marker sequence and the context overall representation into the first target neural network model to obtain a first output result;

[0031] According to the first model weight corresponding to the first target neural network model and the first output result, a first prediction result on the dimension of whether to reply to the message is obtained.

[0032] In an exemplary embodiment of the present disclosure, determining a first conversation message corresponding to the message sending end according to the first prediction result and the second prediction result includes:

[0033] A first dimension weight value is configured for a first prediction result on the dimension of whether to reply to a message, and a second dimension weight value is configured for a second prediction result on the dimension of whether to reply to messages multiple times;

[0034] A weighted sum is performed on the first dimension weight value and the first prediction result, and the second dimension weight value and the second prediction result to obtain a first conversation message corresponding to the message sending end.

[0035] In an exemplary embodiment of the present disclosure, word embedding processing is performed on the user basic information to be predicted based on the embedding mapping layer to obtain a first user feature, including:

[0036] Performing bucket processing on the continuous features in the user basic information to be predicted to obtain bucket results, and performing one-hot encoding on the bucket results and the discrete features in the user basic information to be predicted to obtain a first encoding result;

[0037] Based on the Embedding embedding mapping layer in the embedding mapping layer, word embedding processing is performed on the first encoding result to obtain a first continuous feature vector, and vector concatenation is performed on the first continuous feature vector to obtain a first user feature.

[0038] In an exemplary embodiment of the present disclosure, scoring the first conversation message based on a preset conversation recommendation model to obtain a first scoring result includes:

[0039] A first linear regression part of the first conversation message is calculated based on the internal nodes of the preset conversation recommendation model, and the first linear regression part is normalized based on a normalization layer where a leaf node of the preset conversation recommendation model is located to obtain a first scoring result of the first conversation message.

[0040] In an exemplary embodiment of the present disclosure, the method for sending a session message further includes:

[0041] Determining a first model performance score of the online conversation generation model according to the first scoring result;

[0042] Inputting the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an offline conversation generation model to obtain a second conversation message corresponding to the message sending end;

[0043] Scoring the second conversation message based on a preset conversation recommendation model to obtain a second scoring result, and determining a second model performance score of the offline conversation generation model according to the second scoring result;

[0044] Determining whether it is necessary to replace the online conversation generation model according to the first model performance score and the second model performance score;

[0045] If the online conversation generation model needs to be replaced, the online conversation generation model is replaced based on the offline conversation generation model; if the online conversation generation model does not need to be replaced, the parameters of the offline conversation generation model are fine-tuned until the second model performance score is greater than the first model performance score.

[0046] In an exemplary embodiment of the present disclosure, fine-tuning parameters of the offline conversation generation model includes:

[0047] Acquire first historical user attribute information and a first sent message of a first historical user, and acquire second historical user attribute information and a second sent message of a second historical user corresponding to the first historical user;

[0048] Obtaining first model information for generating a first sent message and second model information for generating a second sent message, and generating historical context content according to the first sent message, the second sent message, the first model information, and the second model information;

[0049] Generate historical user basic information according to the first historical user attribute information and the second historical user attribute information, and determine an actual message reply label and an actual message depth label according to the first sent message and the second sent message;

[0050] Inputting the historical context content and historical user basic information into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label;

[0051] A target loss function is constructed according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and the parameters of the offline conversation generation model are fine-tuned based on the target loss function.

[0052] In an exemplary embodiment of the present disclosure, the historical context content and historical user basic information are input into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label, including:

[0053] Inputting the historical context content and the historical user basic information into an offline conversation generation model to obtain a predicted message reply label indicating whether the second historical user will reply to the first sent message sent by the first historical user;

[0054] A predicted message depth tag is determined based on the predicted message reply tag to determine whether the second historical user will reply a preset number of times to the first sent message sent by the first historical user.

[0055] In an exemplary embodiment of the present disclosure, a target loss function is constructed according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, including:

[0056] Constructing a first loss function according to the actual message reply label and the predicted message reply label, and determining a depth weight value according to the actual message depth label;

[0057] A second loss function is constructed based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and the depth weight value, and a target loss function is constructed based on the first loss function and the second loss function.

[0058] According to one aspect of the present disclosure, a device for sending a session message is provided, including:

[0059] A user attribute information acquisition module, used to acquire first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end;

[0060] A first conversation message determination module, configured to input the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an online conversation generation model, to obtain a first conversation message corresponding to the message sending end;

[0061] a session message determination module to be sent, configured to score the first session messages based on a preset session recommendation model to obtain a first scoring result, and determine the session message to be sent from the first session messages according to the first scoring result;

[0062] The session message sending module is used to determine a target session message in response to a selection operation on the session message to be sent, and send the target session message to the message receiving end.

[0063] In an exemplary embodiment of the present disclosure, the online conversation generation model includes an embedding mapping layer, an encoding layer, and a hybrid expert model layer;

[0064] The first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end, including:

[0065] Generate user basic information to be predicted according to the first user attribute information to be predicted and the second user attribute information to be predicted, and generate context information to be predicted according to the first historical message record, the second historical message record and preset model prompt parameters;

[0066] Based on the embedding mapping layer, word embedding processing is performed on the user basic information to be predicted to obtain a first user feature, and based on the embedding mapping layer, embedding mapping processing is performed on the context information to be predicted to obtain a context marker sequence;

[0067] The first user feature and the context marker sequence are encoded based on the encoding layer to obtain an overall context representation, and the context marker sequence and the overall context representation are predicted based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sender.

[0068] In an exemplary embodiment of the present disclosure, the hybrid expert model layer includes a gated network model and an expert neural network model;

[0069] The step of predicting the context marker sequence and the overall context representation based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sending end includes:

[0070] Determining a model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining a target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight;

[0071] The context marker sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sending end.

[0072] In an exemplary embodiment of the present disclosure, the gated network model includes a first gated network model and a second gated network model;

[0073] Wherein, determining the model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining the target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight, includes:

[0074] Determine, based on the first gating network model and according to the context flag sequence, a first model weight of the expert neural network model on the dimension of whether to reply to a message, and determine, from the expert neural network according to the first model weight, a first target neural network model required to perform a first conversation message prediction task on the dimension of whether to reply to a message;

[0075] Based on the second gating network model, according to the context flag sequence, the second model weight of the expert neural network model on the dimension of whether to make multiple message replies is determined, and according to the second model weight, the second target neural network model required to perform the first conversation message prediction task on the dimension of whether to make multiple message replies is determined from the expert neural network.

[0076] In an exemplary embodiment of the present disclosure, the context marker sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sending end, including:

[0077] Inputting the context marker sequence and the overall context representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message;

[0078] Inputting the context marker sequence and the overall context representation into the second target neural network model to obtain a second prediction result on the dimension of whether to make multiple message replies;

[0079] A first conversation message corresponding to the message sending end is determined according to the first prediction result and the second prediction result.

[0080] In an exemplary embodiment of the present disclosure, the context flag sequence and the overall context representation are input into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message, including:

[0081] Inputting the context marker sequence and the context overall representation into the first target neural network model to obtain a first output result;

[0082] According to the first model weight corresponding to the first target neural network model and the first output result, a first prediction result on the dimension of whether to reply to the message is obtained.

[0083] In an exemplary embodiment of the present disclosure, determining a first conversation message corresponding to the message sending end according to the first prediction result and the second prediction result includes:

[0084] A first dimension weight value is configured for a first prediction result on the dimension of whether to reply to a message, and a second dimension weight value is configured for a second prediction result on the dimension of whether to reply to messages multiple times;

[0085] A weighted sum is performed on the first dimension weight value and the first prediction result, and the second dimension weight value and the second prediction result to obtain a first conversation message corresponding to the message sending end.

[0086] In an exemplary embodiment of the present disclosure, word embedding processing is performed on the user basic information to be predicted based on the embedding mapping layer to obtain a first user feature, including:

[0087] Performing bucket processing on the continuous features in the user basic information to be predicted to obtain bucket results, and performing one-hot encoding on the bucket results and the discrete features in the user basic information to be predicted to obtain a first encoding result;

[0088] Based on the Embedding embedding mapping layer in the embedding mapping layer, word embedding processing is performed on the first encoding result to obtain a first continuous feature vector, and vector concatenation is performed on the first continuous feature vector to obtain a first user feature.

[0089] In an exemplary embodiment of the present disclosure, scoring the first conversation message based on a preset conversation recommendation model to obtain a first scoring result includes:

[0090] A first linear regression part of the first conversation message is calculated based on the internal nodes of the preset conversation recommendation model, and the first linear regression part is normalized based on a normalization layer where a leaf node of the preset conversation recommendation model is located to obtain a first scoring result of the first conversation message.

[0091] In an exemplary embodiment of the present disclosure, the apparatus for sending a session message further includes:

[0092] A first model performance score generating module, configured to determine a first model performance score of the online conversation generation model according to the first scoring result;

[0093] A second conversation message generation module, configured to input the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an offline conversation generation model, to obtain a second conversation message corresponding to the message sending end;

[0094] a second model performance score generating module, configured to score the second conversation message based on a preset conversation recommendation model to obtain a second scoring result, and determine a second model performance score of the offline conversation generation model according to the second scoring result;

[0095] A replacement model determination module, used to determine whether the online conversation generation model needs to be replaced according to the first model performance score and the second model performance score;

[0096] A model parameter fine-tuning module is used to replace the online conversation generation model based on the offline conversation generation model if it is necessary to replace the online conversation generation model; if it is not necessary to replace the online conversation generation model, fine-tune the parameters of the offline conversation generation model until the second model performance score is greater than the first model performance score.

[0097] In an exemplary embodiment of the present disclosure, fine-tuning parameters of the offline conversation generation model includes:

[0098] Acquire first historical user attribute information and a first sent message of a first historical user, and acquire second historical user attribute information and a second sent message of a second historical user corresponding to the first historical user;

[0099] Obtaining first model information for generating a first sent message and second model information for generating a second sent message, and generating historical context content according to the first sent message, the second sent message, the first model information, and the second model information;

[0100] Generate historical user basic information according to the first historical user attribute information and the second historical user attribute information, and determine an actual message reply label and an actual message depth label according to the first sent message and the second sent message;

[0101] Inputting the historical context content and historical user basic information into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label;

[0102] A target loss function is constructed according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and the parameters of the offline conversation generation model are fine-tuned based on the target loss function.

[0103] In an exemplary embodiment of the present disclosure, the historical context content and historical user basic information are input into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label, including:

[0104] Inputting the historical context content and the historical user basic information into an offline conversation generation model to obtain a predicted message reply label indicating whether the second historical user will reply to the first sent message sent by the first historical user;

[0105] A predicted message depth tag is determined based on the predicted message reply tag to determine whether the second historical user will reply a preset number of times to the first sent message sent by the first historical user.

[0106] In an exemplary embodiment of the present disclosure, a target loss function is constructed according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, including:

[0107] Constructing a first loss function according to the actual message reply label and the predicted message reply label, and determining a depth weight value according to the actual message depth label;

[0108] A second loss function is constructed based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and the depth weight value, and a target loss function is constructed based on the first loss function and the second loss function.

[0109] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for sending a conversation message described in any one of the above is implemented.

[0110] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0111] Processor; and

[0112] A memory, configured to store executable instructions of the processor;

[0113] The processor is configured to execute any one of the above-mentioned methods for sending a session message by executing the executable instructions.

[0114] According to the method and device for sending a conversation message of the embodiment of the present disclosure, the first user attribute information to be predicted of the message sending end and the second user attribute information to be predicted of the message receiving end can be obtained, and the first historical message of the message sending end and the second historical message of the message receiving end can be obtained; then the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end; then the first conversation message is scored based on a preset conversation recommendation model to obtain a first scoring result, and the conversation message to be sent is determined from the first conversation message according to the first scoring result; finally, in response to the selection operation for the conversation message to be sent, a target conversation message is determined, and the target conversation message is sent to the message receiving end without selecting a corresponding message from an existing message template for sending, thereby significantly reducing the problem of being unable to generate personalized messages and a high rate of message reuse, and reducing the problem of low accuracy of the obtained conversation message due to the inability to update the message generation rule in real time, thereby bringing a better experience to the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0115] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0116] Figure 1 A flowchart of a method for sending a session message according to an exemplary embodiment of the present disclosure is schematically shown;

[0117] Figure 2 A diagram schematically shows an example structure of a conversation generation model according to an example embodiment of the present disclosure;

[0118] Figure 3 A schematic diagram showing an example structure of a hybrid expert model layer in a conversation generation model according to an example embodiment of the present disclosure is shown;

[0119] Figure 4 A method flow chart schematically illustrates a specific adjustment process of an online conversation generation model according to an exemplary embodiment of the present disclosure;

[0120] Figure 5 A scenario example diagram schematically shows a process of predicting a message reply tag and predicting a message depth tag according to an exemplary embodiment of the present disclosure;

[0121] Figure 6 A method flow chart schematically illustrates a process of generating a first conversation message according to an exemplary embodiment of the present disclosure;

[0122] Figure 7 An example diagram schematically shows a specific model structure of a conversation recommendation model according to an example embodiment of the present disclosure;

[0123] Figure 8 A diagram schematically shows an example scenario of a target conversation message sent by a message sending end according to an example embodiment of the present disclosure;

[0124] Fig. 9 A diagram schematically shows an example scenario in which a message receiving end replies to the target conversation message according to an example embodiment of the present disclosure;

[0125] Fig.10 A schematic diagram of a structure example of a device for sending a session message according to an exemplary embodiment of the present disclosure is shown;

[0126] Fig.11 A computer program product for storing a method for sending a conversation message according to an exemplary embodiment of the present disclosure is schematically shown;

[0127] Fig.12 An electronic device for implementing a method for sending a conversation message according to an exemplary embodiment of the present disclosure is schematically shown.

[0128] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0129] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0130] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0131] According to an embodiment of the present disclosure, a method for sending a session message, an apparatus for sending a session message, a computer-readable storage medium, and an electronic device are proposed.

[0132] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0133] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION

[0135] The applicant has found that in some related conversation message sending methods, many social applications provide corresponding chat message templates (i.e., existing message templates); in the actual conversation message sending process, users can select these templates to start a conversation; however, these templates are usually some general greetings or simple questions, such as "Hello!", "What movies do you like?", etc.; therefore, the solution has the following defects: on the one hand, insufficient personalization: that is, the preset template message cannot be personalized according to the information of the specific user, thereby making the sent message relatively dull; on the other hand, the message reuse rate is high: that is, since all users can use the same template, these messages are easily used frequently, thereby reducing the freshness and attractiveness; on the other hand, the message receiving end has a low success rate in replying to the message: that is, due to the lack of pertinence and personalization, these template messages often fail to arouse the interest of the recipient, resulting in a low success rate for the first contact.

[0136] Furthermore, in other related conversation message sending methods, a rule-based method can be used to generate conversation messages; for example, a chat-up message can be automatically generated and sent according to a series of predefined message generation rules (such as grammatical structure, topic type, etc.); at the same time, these message generation rules are usually designed by linguistic experts to ensure that the generated content conforms to basic language standards. However, this method has the following defects: on the one hand, it is complex and has high maintenance costs: that is, it takes a lot of human resources to design and maintain a large number of complex message generation rules, and it needs to be constantly updated over time to adapt to new social trends; on the other hand, it is not natural: that is, although the message generation rules follow the language standards, the generated content may still appear stiff and unnatural because they lack a deep understanding of human emotions and communication nuances; on the other hand, it is limited in personalization: that is, in the actual application process, although the message generation rules are more flexible than simple templates, the conversation messages generated based on the message generation rules are still difficult to achieve high personalization because the message generation rules mainly rely on fixed patterns rather than dynamic adjustments.

[0137] Based on this, the example embodiments of the present disclosure provide a method for generating conversation messages to solve the following problems that users often face in modern social applications: 1) Lack of suitable topics: users do not know how to start a conversation with the opposite sex; 2) Confusion in expression: users are not sure how to express themselves with a suitable tone and language style; 3) Low success rate: the failure of chatting up is caused by the lack of attractiveness of the message at the time of the first contact. In addition, the method for generating conversation messages provided by the example embodiments of the present disclosure can also realize personalized customization and intelligent recommendation of chatting up messages, and help users start a conversation with the opposite sex more naturally and effectively in social applications by accurately matching the interests and communication styles of both parties, thereby improving the contact success rate and achieving the purpose of improving user experience.

[0138] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0139] Exemplary Methods

[0140] The exemplary embodiment of the present disclosure first provides a method for sending a session message, which can be run on a terminal device; of course, those skilled in the art can also run the method of the present disclosure on other platforms as required, and this exemplary embodiment does not specifically limit this. Figure 1 As shown, the method for sending the field conversation message may include the following steps:

[0141] Step S110. Acquire first to-be-predicted user attribute information of the message sending end and second to-be-predicted user attribute information of the message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end;

[0142] Step S120: input the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record into an online conversation generation model to obtain a first conversation message corresponding to the message sending end;

[0143] Step S130: scoring the first conversation messages based on a preset conversation recommendation model to obtain a first scoring result, and determining the conversation messages to be sent from the first conversation messages according to the first scoring result;

[0144] Step S140: Determine a target session message in response to the selection operation on the session message to be sent, and send the target session message to the message receiving end.

[0145] In the above method for sending a conversation message, since the first user attribute information to be predicted of the message sending end and the second user attribute information to be predicted of the message receiving end can be obtained, and the first historical message of the message sending end and the second historical message of the message receiving end can be obtained; then the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end; then the first conversation message is scored based on a preset conversation recommendation model to obtain a first scoring result, and the conversation message to be sent is determined from the first conversation message according to the first scoring result; finally, in response to the selection operation for the conversation message to be sent, a target conversation message is determined, and the target conversation message is sent to the message receiving end without selecting a corresponding message from an existing message template for sending, thereby significantly reducing the problem of being unable to generate personalized messages and a high rate of message reuse, and reducing the problem of low accuracy of the obtained conversation message due to the inability to update the message generation rule in real time, thereby bringing a better experience to the user.

[0146] Hereinafter, the method for sending a session message described in the exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.

[0147] First, the terms involved in the exemplary embodiments of the present disclosure are explained and illustrated.

[0148] One-Hot encoding: refers to encoding discrete type feature attributes into a string of 0-1;

[0149] Embedding: Convert One-Hot encoding into a continuous vector of fixed length;

[0150] Bidirectional Transformer: Bidirectional Transformer is a neural network architecture that generates more comprehensive contextual representations by considering both the context of sequence data.

[0151] LLM: Large Language Model (LLM) refers to a deep learning model trained with a large amount of text data that can generate natural language text or understand the meaning of language text;

[0152] Bert: Bidirectional Encoder Representations from Transformers is a pre-trained language model.

[0153] Secondly, the technical implementation principle of the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, the method for sending a conversation message recorded in the exemplary embodiment of the present disclosure can generate the required conversation message based on AIGC (Artificial Intelligence Generated Content). Further, in the actual application process, the information of both users (such as gender, age, hometown, historical chat records, etc.) can be obtained from the corresponding social application; then, the preset multiple prompts and corresponding LLMs are used to generate multiple pick-up messages that meet the current characteristics of both parties (including content, tone, dialect characteristics, etc.) according to the user information; further, each generated pick-up message is scored through the recommendation model, and sorted according to the score, and the TopN best pick-up messages are recommended for users to choose. At the same time, based on the method for sending a conversation message recorded in the exemplary embodiment of the present disclosure, it can provide users in social applications with a new type of conversation message generation tool that is intelligent, efficient and highly personalized, effectively improving the success rate of first contact with the opposite sex, and improving the overall user experience.

[0154] Furthermore, based on the method for sending a conversation message described in the exemplary embodiment of the present disclosure, not only can personalized messages be generated, but also target conversation messages can be recommended and the conversation generation model can be optimized. Specifically, in the dimension of generating personalized messages, the following problems can be solved: in modern social applications, users often do not know how to start a conversation with the opposite sex; and existing social applications usually only provide simple preset templates or general suggestions, which cannot generate personalized, natural and effective pick-up messages based on specific user information, which leads to users lacking suitable topics and expressing confusion during the first contact; further, in the dimension of conversation message recommendation, the following problems can be solved: even if multiple potential pick-up messages are generated, users still face selection difficulties and are not sure which message is most suitable for the current situation; therefore, if there is a lack of effective methods to evaluate and recommend the best pick-up messages, the success rate of the first contact will also be reduced; further, in the dimension of conversation generation model optimization, the following problems can be solved: in the process of generating personalized pick-up messages, the use of large-scale pre-trained language models can significantly improve the quality and naturalness of the generated content; however, different models and different prompt designs will have a greater impact on the generation results, and the cost of using different LLMs also needs to be considered; therefore, how to select prompts and models and evaluate their effects to ensure that the generated pick-up messages are optimal is also a problem that needs to be solved urgently.

[0155] The following will explain and illustrate the conversation generation model described in the exemplary embodiment of the present disclosure. Figure 2As shown, the conversation generation model may include a first input layer 210, an embedding mapping layer 220, an encoding layer 230, a hybrid expert model layer 240, and a first output layer 250; at the same time, referring to Figure 3 As shown, the hybrid expert model layer recorded here may include a gated network model and an expert neural network model; the gated network model recorded here may include a first gated network model and a second gated network model; further, the specific operations required to be performed at each model level will be described in detail later, and no further details will be given here. Furthermore, the encoding layer 230 recorded here may be a multi-layer bidirectional Transformer or a deep interest network (DIN). In the actual application process, it can be determined according to actual needs, and this example does not impose any special restrictions on this; and the hybrid expert model layer recorded here may be implemented based on Expert or on a factor decomposition machine (FM). In the actual application process, it may be determined according to actual needs, and this example does not impose any special restrictions on this.

[0156] The following will explain and illustrate the specific adjustment process of the online conversation generation model. Figure 4 As shown, the specific adjustment process of the online conversation generation model may include the following steps:

[0157] Step S410: Determine a first model performance score of the online conversation generation model according to the first scoring result.

[0158] Specifically, the specific calculation method of the first scoring result can be implemented as follows: first, select the TopN session messages from the first session messages according to the first scoring result; then, calculate the average of the first scoring results of the selected TopN session messages to obtain a first TopN average score; further, calculate the average of the first scoring results of all Top1 session messages to obtain a first Top1 average score; then, the first model performance score can be obtained according to the first TopN average score and the first Top1 average score; at the same time, in the process of determining the first model performance score, the first TopN average score and the first Top1 average score can be directly summed, or weighted summed or the average of the two can be calculated, etc. This example does not impose any special restrictions on this.

[0159] Step S420: input the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record into an offline conversation generation model to obtain a second conversation message corresponding to the message sending end.

[0160] Specifically, the specific generation process of the second conversation message is similar to the specific generation process of the first conversation message, except that the specific values ​​of the parameters of the offline conversation generation model and the online conversation generation model are different; therefore, the specific generation process of the second conversation message is not further described here.

[0161] Step S430: Score the second conversation message based on the preset conversation recommendation model to obtain a second scoring result, and determine a second model performance score of the offline conversation generation model according to the second scoring result.

[0162] Specifically, the specific process of determining the second scoring result and the second model performance score is similar to the specific process of determining the first scoring result and the first model performance score, and will not be further elaborated here.

[0163] Step S440: Determine whether the online conversation generation model needs to be replaced according to the first model performance score and the second model performance score.

[0164] Specifically, it can be directly determined whether the first model performance score is greater than the second model performance score; if so, it is determined that the online conversation generation model does not need to be replaced; if not, it is determined that the online conversation generation model needs to be replaced.

[0165] Step S450: if the online conversation generation model needs to be replaced, the online conversation generation model is replaced based on the offline conversation generation model; if the online conversation generation model does not need to be replaced, the parameters of the offline conversation generation model are fine-tuned until the second model performance score is greater than the first model performance score.

[0166] Specifically, the replacement of the online conversation generation model can be achieved in the following ways: first, extracting the parameter values ​​of the model parameters in the offline conversation generation model; second, replacing the parameter values ​​of the model parameters in the online conversation generation model based on the parameter values ​​of the model parameters in the offline conversation generation model.

[0167] Furthermore, in the process of fine-tuning the parameters of the offline conversation generation model, it can be achieved in the following way: first, obtain the first historical user attribute information and the first sent message of the first historical user, and obtain the second historical user attribute information and the second sent message of the second historical user corresponding to the first historical user; secondly, obtain the first model information for generating the first sent message and the second model information for generating the second sent message, and generate the historical context content according to the first sent message, the second sent message, the first model information and the second model information; then, generate the historical user basic information according to the first historical user attribute information and the second historical user attribute information, and determine the actual message reply label and the actual message depth label according to the first sent message and the second sent message; further, input the historical context content and the historical user basic information into the offline conversation generation model to obtain the predicted message reply label and the predicted message depth label; finally, construct the target loss function according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and fine-tune the parameters of the offline conversation generation model based on the target loss function.

[0168] In an exemplary embodiment, the historical context content and the historical user basic information are input into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label. This can be achieved in the following way: the historical context content and the historical user basic information are input into an offline conversation generation model to obtain a predicted message reply label indicating whether the second historical user will reply to the first sent message sent by the first historical user; based on the predicted message reply label, a predicted message depth label indicating whether the second historical user will reply a preset number of times to the first sent message sent by the first historical user is determined.

[0169] In an exemplary embodiment, constructing a target loss function based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label can be achieved in the following manner: constructing a first loss function based on the actual message reply label and the predicted message reply label, and determining a depth weight value based on the actual message depth label; constructing a second loss function based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label and the depth weight value, and constructing a target loss function based on the first loss function and the second loss function.

[0170] The following will further explain and illustrate the specific fine-tuning process of the conversation generation model. Specifically, in the actual application process, first, it is necessary to obtain the conversation data generated in the past N days from the social application; wherein each conversation data may include the sender id (also known as the first historical user identifier), the receiver id (also known as the second historical user identifier), the sending time of the pick-up message (the first sent message), whether the receiver replied, the total number of messages replied by the receiver, etc.; then, construct the features and labels of the training samples; wherein the historical user feature information recorded above may include the user ID of the first historical user and the second historical user, the user's gender, user age, user's place of origin, the industry and specific occupation of the user, user height, user weight, user education, user income, user location The region, user level, operating system of the terminal device used by the user, whether the user is a member user, the number of people followed by the user and the number of people who follow the user, etc.; the historical context content may include the time when the message was sent, the message content, the identifier of the prompt information used to generate the message, the model identifier of the model used to generate the message, the parameter identifier of the model used to generate the message, and the actual distance between the first historical user and the second historical user, etc.; further, the actual message reply label refers to whether the second historical user has replied (1 if the recipient has replied, otherwise 0) and the actual message depth label refers to the number of messages replied by the second historical user (1 if the number of replies is greater than 5, otherwise 0).

[0171] It should be noted that the prompt information recorded above may include temperature parameter information, TopP parameter information, existence penalty parameter information, frequency penalty parameter information and maximum mark parameter information; wherein, temperature parameter information may be used to characterize the learning rate of the conversation generation model, TopP parameter information may be used to characterize the number of conversation information that the model needs to recall, existence penalty parameter information may be used to characterize the number of duplicate messages generated by the model, and frequency penalty parameter information may be used to characterize the frequency of duplicate messages generated by the model; maximum mark parameter information may be used to characterize the maximum number of conversation messages that the model may generate; further, the specific value of each parameter may be set according to actual needs, and this example does not impose any special restrictions on this.

[0172] Furthermore, after obtaining the historical context content and historical user basic information, feature preprocessing is required; wherein, feature preprocessing can be achieved in the following ways: first, for discrete features, One-Hot encoding can be performed directly; second, for continuous features, bucketing can be performed (nine bucket boundaries are defined according to the 10th, 20th, 30th, and 90th percentiles of the feature of all users sorted from small to large), and then the bucket label is One-Hot encoded; finally, for the message text, it can be converted into a Token sequence through a pre-trained model (BERT).

[0173] Furthermore, after the preprocessing is completed, the corresponding features can be input into the offline conversation generation model to obtain the predicted message reply label and the predicted message depth label. In the process of determining the predicted message reply label and the predicted message depth label, the predicted message reply label and the predicted message depth label can be based on Figure 5 The example diagram shown is implemented; specifically, in Figure 5 In the example, each dimension is first converted into a continuous feature vector of 128 dimensions through the Embedding network; then, it passes through 3 layers of bidirectional Transformer and 5 Expert networks in sequence to finally obtain P_label1 and P_label2; among them, P_label1 is the predicted message reply label, and P_label2 is the predicted message depth label.

[0174] Finally, after obtaining the predicted message reply label and the predicted message depth label, the loss function can be constructed and the model parameters can be trained by back propagation. The target loss function can be shown in the following formula (1)-formula (3):

[0175] Loss(θ label1 ,θ label2 )=Loss1+Loss2; Formula (1)

[0176]

[0177] Wherein, N represents the number of user pairs consisting of the first historical user and the second historical user, i represents the i-th pair of users; f(x i ,θ label1 ) indicates the predicted message reply label P_label1; f(x i ,θ label2 ) indicates the predicted message depth label P_label2; y label1 Indicates the actual message reply label; y label2 Indicates the actual message depth label; weight label2Represents the weight value of the predicted message depth label; wherein, the number of predicted message replies is proportional to the weight value of the predicted message depth label.

[0178] At this point, the fine-tuning process of the offline conversation generation model has been fully realized.

[0179] The following will be combined Figure 2-Figure 5 right Figure 1 The method for sending the session message shown in is further explained and illustrated. Specifically:

[0180] In step S110, first to-be-predicted user attribute information of the message sending end and second to-be-predicted user attribute information of the message receiving end are obtained, and first historical messages of the message sending end and second historical messages of the message receiving end are obtained.

[0181] Specifically, the first user attribute information to be predicted recorded here may include, but is not limited to, the user ID of the first target user corresponding to the message sender, the user gender, the user age, the user's place of origin, the industry and specific occupation of the user, the user height, the user weight, the user's education level, the user's income, the region where the user is located, the user level, the operating system of the terminal device used by the user, whether the user is a member user, the number of people followed by the user and the number of people who follow the user, etc.; at the same time, the second user attribute information to be predicted recorded here is similar to the first user attribute information to be predicted, and will not be further elaborated here; further, the first historical message recorded here refers to all messages sent by the first target user in the application platform; the acquisition of attribute information and historical messages can be obtained from the server corresponding to the application platform.

[0182] In step S120, the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end.

[0183] Specifically, refer to Figure 6 As shown, the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into the online conversation generation model to obtain the first conversation message corresponding to the message sending end, which may include the following steps:

[0184] Step S610, generating user basic information to be predicted according to the first user attribute information to be predicted and the second user attribute information to be predicted, and generating context information to be predicted according to the first historical message record, the second historical message record and preset model prompt parameters.

[0185] Specifically, the basic user information to be predicted recorded here may include the user identification of the first target user and the second target user corresponding to the first target user, the user gender, the user age, the user's place of origin, the industry in which the user is engaged and the specific occupation, the user height, the user weight, the user's education level, the user's income, the region in which the user is located, the user level, the operating system of the terminal device used by the user, whether the user is a member user, the number of people followed by the user and the number of people who follow the user, etc.; the preset model prompt parameters involved in the context information to be predicted recorded here may include but are not limited to prompt question prompt and temperature parameter information, TopP parameter information, existence penalty parameter information, frequency penalty parameter information and maximum mark parameter information, etc.

[0186] Step S620: performing word embedding processing on the user basic information to be predicted based on the embedding mapping layer to obtain a first user feature, and performing embedding mapping processing on the context information to be predicted based on the embedding mapping layer to obtain a context marker sequence.

[0187] In this example embodiment, first, the user basic information to be predicted is word-embedded based on the embedding mapping layer to obtain the first user feature; specifically, it can be implemented in the following manner: the continuous features in the user basic information to be predicted are bucketed to obtain bucket results, and the bucket results and the discrete features in the user basic information to be predicted are one-hot encoded to obtain the first encoding result; the first encoding result is word-embedded based on the Embedding embedding mapping layer in the embedding mapping layer to obtain the first continuous feature vector, and the first continuous feature vector is vector-concatenated to obtain the first user feature. That is, in the actual application process, for continuous features (such as age, height, weight, income, the number of people followed by the user and the number of people who follow the user), etc., it is necessary to first perform bucketing, and then perform one-hot encoding and word embedding.

[0188] It should be noted here that the embedding mapping layer described above may include an Embdding embedding mapping layer and a Bert embedding mapping layer; wherein, the word embedding process of the first user feature can be implemented based on the Embdding embedding mapping layer and the Bert embedding mapping layer; and the word embedding process of the context information to be predicted can be implemented based on the Embdding embedding mapping layer and the Bert embedding mapping layer; wherein, the word embedding process of the preset model prompt parameters in the context information to be predicted can be implemented based on the mbdding embedding mapping layer, and the message record in the context information to be predicted can be implemented based on the Bert embedding mapping layer.

[0189] Step S630: encoding the first user feature and the context marker sequence based on the encoding layer to obtain the overall context representation, and predicting the context marker sequence and the overall context representation based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sender.

[0190] In this exemplary embodiment, first, the first user feature and the context marker sequence can be encoded based on the encoding layer to obtain the overall context representation; wherein, the encoding layer recorded here can be a multi-layer bidirectional Transformer; at the same time, the specific number of layers of the bidirectional Transformer can be 3 layers or other layers, and this example does not impose any special restrictions on this; that is, in the actual application process, it is necessary to encode the first user feature and the context marker sequence based on the multi-layer bidirectional Transformer to obtain the overall context representation. Secondly, after the overall context representation is obtained, the context marker sequence and the overall context representation can be predicted based on the hybrid expert model layer to obtain the first conversation message; wherein the specific prediction process can be implemented in the following manner: first, based on the gated network model, the model weight of the expert neural network model is determined according to the context marker sequence, and the target neural network model required to perform the first conversation message prediction task is determined from the expert neural network according to the model weight; secondly, the context marker sequence and the overall context representation are input into the target neural network model to obtain the first conversation message corresponding to the message sending end. That is to say, in the actual application process, it is necessary to determine the target expert network that performs different tasks from the expert neural network, so as to achieve the purpose of improving the accuracy of the final prediction results.

[0191] In an exemplary embodiment, determining the model weight of the expert neural network model according to the context flag sequence based on the gated network model, and determining the target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight can be implemented as follows: determining the first model weight of the expert neural network model on the dimension of whether to reply to the message based on the first gated network model according to the context flag sequence, and determining the first target neural network model required to perform the first conversation message prediction task on the dimension of whether to reply to the message from the expert neural network according to the first model weight; determining the second model weight of the expert neural network model on the dimension of whether to reply to multiple messages based on the second gated network model according to the context flag sequence, and determining the second target neural network model required to perform the first conversation message prediction task on the dimension of whether to reply to multiple messages from the expert neural network according to the second model weight. It should be supplemented here that the number of gated network models recorded here can be determined according to the type of task to be performed; for example, if only the first conversation message prediction task on the dimension of whether to reply to the message needs to be performed, only one gated network model needs to be set; for example, if three or more prediction tasks on different dimensions need to be performed, three or more gated network models can be set. Of course, in some special example embodiments, a variety of different prediction tasks can also be implemented based on a gated network model, and this example does not impose any special restrictions on this.

[0192] In an exemplary embodiment, inputting a context flag sequence and a context overall representation into a target neural network model to obtain a first conversation message corresponding to a message sender can be implemented as follows: first, inputting the context flag sequence and the context overall representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to a message; second, inputting the context flag sequence and the context overall representation into the second target neural network model to obtain a second prediction result on the dimension of whether to reply to messages multiple times; then, according to the first prediction result and the second prediction result, determining the first conversation message corresponding to the message sender. Specifically, in the process of determining the first conversation message, it can be implemented as follows: configuring a first dimension weight value for the first prediction result on the dimension of whether to reply to a message, and configuring a second dimension weight value for the second prediction result on the dimension of whether to reply to messages multiple times; performing weighted summation of the first dimension weight value and the first prediction result, the second dimension weight value and the second prediction result to obtain the first conversation message corresponding to the message sender. That is to say, in the process of actual application, different weights can be configured according to actual needs, so as to obtain different first conversation messages; as for the specific weight configuration, it can be determined according to actual needs; for example, if more attention is paid to whether the second target user replies to the message, the weight value of the first dimension can be increased; for example, if more attention is paid to the need for the second target user to make multiple replies, the weight value of the second dimension can be increased; in the process of actual application, it can be determined by yourself according to actual needs.

[0193] In an exemplary embodiment, the context flag sequence and the overall context representation are input into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message. This can be achieved in the following manner: the context flag sequence and the overall context representation are input into the first target neural network model to obtain a first output result; based on the first model weight corresponding to the first target neural network model and the first output result, a first prediction result on the dimension of whether to reply to the message is obtained. In other words, in the process of performing prediction tasks of different dimensions, since it is necessary to perform through multiple expert networks, when obtaining the final result, it is also necessary to comprehensively consider the output results of each expert network model to obtain the first prediction result.

[0194] It should be noted that the specific process of determining the second prediction result is similar to the specific process of determining the first prediction result, and will not be further elaborated here.

[0195] In step S130, the first conversation message is scored based on a preset conversation recommendation model to obtain a first scoring result, and a conversation message to be sent is determined from the first conversation messages according to the first scoring result.

[0196] In this example embodiment, first, the first conversation message is scored based on a preset conversation recommendation model to obtain a first scoring result; wherein, the preset conversation recommendation model recorded herein may include a deep neural network model, or a decision tree model, etc.; meanwhile, the deep neural network model recorded herein may include, but is not limited to, a deep feedforward neural network, a convolutional neural network, a recurrent neural network, a long short-term memory network, a gated recurrent unit, and a generative adversarial network, etc. Further, taking the decision tree model as an example, the specific scoring process can be implemented as follows: based on the internal nodes of the preset conversation recommendation model, the first linear regression part of the first conversation message is calculated, and based on the normalization layer where the leaf nodes of the preset conversation recommendation model are located, the first linear regression part is normalized to obtain a first scoring result for the first conversation message. Meanwhile, the specific model structure of the conversation recommendation model can be referred to. Figure 7 Further, after obtaining the first scoring result, several conversation messages with the highest scores can be selected from the first scoring result as conversation messages to be sent.

[0197] In step S140, a target session message is determined in response to the selection operation on the session message to be sent, and the target session message is sent to the message receiving end.

[0198] Specifically, when the conversation message to be sent is determined to be completed, it can be displayed on the display interface of the message sending end; when the first target user views the displayed conversation message to be sent, he can select the corresponding target conversation message according to his own preferences or needs, and send it to the message receiving end; when the message receiving end receives the target conversation message, it can determine whether to reply or whether to reply multiple times according to actual conditions; wherein, the scene diagram of the target conversation message sent by the message sending end can refer to Figure 8 At the same time, the scenario diagram of the message receiving end replying to the target session message can be referred to Fig. 9 shown.

[0199] So far, the method for sending a session message described in the exemplary embodiments of the present disclosure has been fully implemented. Based on the above-mentioned contents, it can be known that the method for sending conversation messages recorded in the example embodiment of the present disclosure realizes personalized customization and intelligent recommendation by accurately matching the interests and communication styles of both parties, and has at least the following advantages: on the one hand, improving the success rate of first contact: by using a large-scale pre-trained language model (LLM) to generate personalized pick-up messages, and combining machine learning algorithms for scoring and recommendation, the success rate of users' first contact with the opposite sex in social applications can be significantly improved; at the same time, personalized messages can arouse the other party's interest, thereby increasing the reply rate; on the other hand, data-driven optimization can be improved: the example embodiment of the present disclosure adopts a data-driven method to continuously collect and analyze user behavior data to optimize the combination of <large model+Prompt+model parameters>; at the same time, this continuous optimization mechanism ensures that the system is always in the best state, can adapt to new social trends and user needs in a timely manner, and improve the overall strategy efficiency; on the other hand, diversity and flexibility: using multiple prompts and different large-scale language models, the example embodiment of the present disclosure can generate diversified and creative pick-up messages to meet the needs of different types of users; at the same time, through the scoring and recommendation mechanism, the generation strategy can be flexibly adjusted to adapt to different scenarios and target groups.

[0200] Exemplary Devices

[0201] After introducing the method for sending a session message according to an exemplary embodiment of the present disclosure, Fig.10 The apparatus for sending a session message according to an exemplary embodiment of the present disclosure is explained and described. Fig.10 As shown, the apparatus for sending a session message may include a user attribute information acquisition module 1010, a first session message determination module 1020, a session message determination module 1030 to be sent, and a session message sending module 1040. Specifically:

[0202] The user attribute information acquisition module 1010 may be used to acquire first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end;

[0203] The first conversation message determination module 1020 may be used to input the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an online conversation generation model to obtain a first conversation message corresponding to the message sending end;

[0204] The to-be-sent conversation message determination module 1030 may be configured to score the first conversation message based on a preset conversation recommendation model to obtain a first scoring result, and determine the to-be-sent conversation message from the first conversation message according to the first scoring result;

[0205] The session message sending module 1040 may be configured to determine a target session message in response to a selection operation on the session message to be sent, and send the target session message to the message receiving end.

[0206] In an exemplary embodiment of the present disclosure, the online conversation generation model includes an embedding mapping layer, an encoding layer, and a hybrid expert model layer; wherein the first user attribute information to be predicted, the first historical message record, the second user attribute information to be predicted, and the second historical message record are input into the online conversation generation model to obtain a first conversation message corresponding to the message sending end, including: generating user basic information to be predicted according to the first user attribute information to be predicted and the second user attribute information to be predicted, and generating context information to be predicted according to the first historical message record, the second historical message record, and preset model prompt parameters; performing word embedding processing on the user basic information to be predicted based on the embedding mapping layer to obtain a first user feature, and performing embedding mapping processing on the context information to be predicted based on the embedding mapping layer to obtain a context marker sequence; encoding processing on the first user feature and the context marker sequence based on the encoding layer to obtain a context overall representation, and predicting the context marker sequence and the context overall representation based on the hybrid expert model layer to obtain the first conversation message corresponding to the message sending end.

[0207] In an exemplary embodiment of the present disclosure, the hybrid expert model layer includes a gating network model and an expert neural network model; wherein, predicting the context flag sequence and the overall context representation based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sending end includes: determining a model weight of the expert neural network model according to the context flag sequence based on the gating network model, and determining a target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight; inputting the context flag sequence and the overall context representation into the target neural network model to obtain the first conversation message corresponding to the message sending end.

[0208] In an exemplary embodiment of the present disclosure, the gated network model includes a first gated network model and a second gated network model; wherein, determining the model weight of the expert neural network model based on the context flag sequence based on the gated network model, and determining the target neural network model required to perform the first conversation message prediction task from the expert neural network based on the model weight includes: determining the first model weight of the expert neural network model on the dimension of whether to reply to a message based on the first gated network model based on the context flag sequence, and determining the first target neural network model required to perform the first conversation message prediction task on the dimension of whether to reply to a message based on the first model weight; determining the second model weight of the expert neural network model on the dimension of whether to make multiple message replies based on the second gated network model based on the context flag sequence, and determining the second target neural network model required to perform the first conversation message prediction task on the dimension of whether to make multiple message replies from the expert neural network based on the second model weight.

[0209] In an exemplary embodiment of the present disclosure, the context flag sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sender, including: inputting the context flag sequence and the overall context representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message; inputting the context flag sequence and the overall context representation into the second target neural network model to obtain a second prediction result on the dimension of whether to make multiple message replies; and determining the first conversation message corresponding to the message sender based on the first prediction result and the second prediction result.

[0210] In an exemplary embodiment of the present disclosure, the context flag sequence and the overall context representation are input into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message, including: inputting the context flag sequence and the overall context representation into the first target neural network model to obtain a first output result; obtaining a first prediction result on the dimension of whether to reply to the message based on the first model weight corresponding to the first target neural network model and the first output result.

[0211] In an exemplary embodiment of the present disclosure, a first conversation message corresponding to the message sender is determined based on the first prediction result and the second prediction result, including: configuring a first dimension weight value for the first prediction result on the dimension of whether to reply to the message, and configuring a second dimension weight value for the second prediction result on the dimension of whether to make multiple message replies; performing weighted summation of the first dimension weight value and the first prediction result, the second dimension weight value and the second prediction result to obtain the first conversation message corresponding to the message sender.

[0212] In an exemplary embodiment of the present disclosure, word embedding processing is performed on the user basic information to be predicted based on the embedding mapping layer to obtain a first user feature, including: bucketing the continuous features in the user basic information to be predicted to obtain bucketing results, and one-hot encoding the bucketing results and the discrete features in the user basic information to be predicted to obtain a first encoding result; word embedding processing is performed on the first encoding result based on the Embedding embedding mapping layer in the embedding mapping layer to obtain a first continuous feature vector, and vector concatenation is performed on the first continuous feature vector to obtain a first user feature.

[0213] In an exemplary embodiment of the present disclosure, scoring the first conversation message based on a preset conversation recommendation model to obtain a first scoring result includes: calculating a first linear regression part of the first conversation message based on an inner node of the preset conversation recommendation model, and normalizing the first linear regression part based on a normalization layer where a leaf node of the preset conversation recommendation model is located to obtain a first scoring result of the first conversation message.

[0214] In an exemplary embodiment of the present disclosure, the apparatus for sending a session message further includes:

[0215] A first model performance score generating module, configured to determine a first model performance score of the online conversation generation model according to the first scoring result;

[0216] A second conversation message generation module, configured to input the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an offline conversation generation model, to obtain a second conversation message corresponding to the message sending end;

[0217] a second model performance score generating module, configured to score the second conversation message based on a preset conversation recommendation model to obtain a second scoring result, and determine a second model performance score of the offline conversation generation model according to the second scoring result;

[0218] A replacement model determination module, used to determine whether the online conversation generation model needs to be replaced according to the first model performance score and the second model performance score;

[0219] A model parameter fine-tuning module is used to replace the online conversation generation model based on the offline conversation generation model if it is necessary to replace the online conversation generation model; if it is not necessary to replace the online conversation generation model, fine-tune the parameters of the offline conversation generation model until the second model performance score is greater than the first model performance score.

[0220] In an exemplary embodiment of the present disclosure, the offline conversation generation model is fine-tuned in parameters, including: obtaining first historical user attribute information and a first sent message of a first historical user, and obtaining second historical user attribute information and a second sent message of a second historical user corresponding to the first historical user; obtaining first model information for generating the first sent message and second model information for generating the second sent message, and generating historical context content according to the first sent message, the second sent message, the first model information and the second model information; generating historical user basic information according to the first historical user attribute information and the second historical user attribute information, and determining an actual message reply label and an actual message depth label according to the first sent message and the second sent message; inputting the historical context content and the historical user basic information into the offline conversation generation model to obtain a predicted message reply label and a predicted message depth label; constructing a target loss function according to the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, and fine-tuning the parameters of the offline conversation generation model based on the target loss function.

[0221] In an exemplary embodiment of the present disclosure, the historical context content and the historical user basic information are input into an offline conversation generation model to obtain a predicted message reply label and a predicted message depth label, including: inputting the historical context content and the historical user basic information into an offline conversation generation model to obtain a predicted message reply label of whether the second historical user will reply to the first sent message sent by the first historical user; based on the predicted message reply label, determining a predicted message depth label of whether the second historical user will reply a preset number of times to the first sent message sent by the first historical user.

[0222] In an exemplary embodiment of the present disclosure, a target loss function is constructed based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label, including: constructing a first loss function based on the actual message reply label and the predicted message reply label, and determining a depth weight value based on the actual message depth label; constructing a second loss function based on the actual message reply label and the predicted message reply label, the actual message depth label and the predicted message depth label and the depth weight value, and constructing a target loss function based on the first loss function and the second loss function.

[0223] Exemplary Storage Media

[0224] After introducing the method for sending a session message and the device for sending a session message according to the exemplary embodiment of the present disclosure, next, referring to Fig.11 A storage medium according to an exemplary embodiment of the present disclosure is described.

[0225] refer to Fig.11 As shown, a program product 1100 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.

[0226] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0227] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Readable signal media may also be any readable medium other than a readable storage medium.

[0228] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN).

[0229] Exemplary Electronic Devices

[0230] After introducing the storage medium of the exemplary embodiment of the present disclosure, next, reference is made to Fig.12 An electronic device according to an exemplary embodiment of the present disclosure is described.

[0231] Fig.12 The electronic device 1200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0232] like Fig.12 As shown, the electronic device 1200 is in the form of a general computing device. The components of the electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one storage unit 1220, a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210), and a display unit 1240.

[0233] The storage unit 1220 stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1210 can perform the following steps: Figure 1 Steps S110-S140 shown in FIG.

[0234] The storage unit 1220 may include a volatile storage unit, such as a random access storage unit (RAM) 12201 and / or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .

[0235] The storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0236] The bus 1230 may include a data bus, an address bus, and a control bus.

[0237] The electronic device 1200 may also communicate with one or more external devices 1300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.) through an input / output (I / O) interface 1250. Furthermore, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 through a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0238] It should be noted that, although several units / modules or subunits / modules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0239] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0240] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A method for sending a session message, characterized in that: include: Acquire first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end; Inputting the first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record into an online conversation generation model to obtain a first conversation message corresponding to the message sending end; Scoring the first conversation messages based on a preset conversation recommendation model to obtain a first scoring result, and determining a conversation message to be sent from the first conversation messages according to the first scoring result; In response to the selection operation on the to-be-sent session message, a target session message is determined, and the target session message is sent to the message receiving end.

2. The method for sending a session message according to claim 1, characterized in that: The online conversation generation model includes an embedding mapping layer, an encoding layer, and a hybrid expert model layer; The first user attribute information to be predicted and the first historical message record, the second user attribute information to be predicted and the second historical message record are input into an online conversation generation model to obtain a first conversation message corresponding to the message sending end, including: Generate user basic information to be predicted according to the first user attribute information to be predicted and the second user attribute information to be predicted, and generate context information to be predicted according to the first historical message record, the second historical message record and preset model prompt parameters; Based on the embedding mapping layer, word embedding processing is performed on the user basic information to be predicted to obtain a first user feature, and based on the embedding mapping layer, embedding mapping processing is performed on the context information to be predicted to obtain a context marker sequence; The first user feature and the context marker sequence are encoded based on the encoding layer to obtain an overall context representation, and the context marker sequence and the overall context representation are predicted based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sender.

3. The method for sending a session message according to claim 2, characterized in that: The hybrid expert model layer includes a gated network model and an expert neural network model; The step of predicting the context marker sequence and the overall context representation based on the hybrid expert model layer to obtain a first conversation message corresponding to the message sending end includes: Determining a model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining a target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight; The context marker sequence and the overall context representation are input into the target neural network model to obtain a first conversation message corresponding to the message sending end.

4. The method for sending a session message according to claim 3, characterized in that: The gated network model includes a first gated network model and a second gated network model; Wherein, determining the model weight of the expert neural network model according to the context marker sequence based on the gated network model, and determining the target neural network model required to perform the first conversation message prediction task from the expert neural network according to the model weight, includes: Determine, based on the first gating network model and according to the context flag sequence, a first model weight of the expert neural network model on the dimension of whether to reply to a message, and determine, from the expert neural network according to the first model weight, a first target neural network model required to perform a first conversation message prediction task on the dimension of whether to reply to a message; Based on the second gating network model, according to the context flag sequence, the second model weight of the expert neural network model on the dimension of whether to make multiple message replies is determined, and according to the second model weight, the second target neural network model required to perform the first conversation message prediction task on the dimension of whether to make multiple message replies is determined from the expert neural network.

5. The method for sending a session message according to claim 4, characterized in that: Inputting the context marker sequence and the context overall representation into the target neural network model to obtain a first conversation message corresponding to the message sending end, including: Inputting the context marker sequence and the overall context representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message; Inputting the context marker sequence and the overall context representation into the second target neural network model to obtain a second prediction result on the dimension of whether to make multiple message replies; A first conversation message corresponding to the message sending end is determined according to the first prediction result and the second prediction result.

6. The method for sending a session message according to claim 5, characterized in that: Inputting the context flag sequence and the overall context representation into the first target neural network model to obtain a first prediction result on the dimension of whether to reply to the message, including: Inputting the context marker sequence and the context overall representation into the first target neural network model to obtain a first output result; According to the first model weight corresponding to the first target neural network model and the first output result, a first prediction result on the dimension of whether to reply to the message is obtained.

7. The method for sending a session message according to claim 5, characterized in that: Determining a first conversation message corresponding to the message sending end according to the first prediction result and the second prediction result includes: A first dimension weight value is configured for a first prediction result on the dimension of whether to reply to a message, and a second dimension weight value is configured for a second prediction result on the dimension of whether to reply to messages multiple times; A weighted sum is performed on the first dimension weight value and the first prediction result, and the second dimension weight value and the second prediction result to obtain a first conversation message corresponding to the message sending end.

8. A device for sending a conversation message, characterized in that: include: A user attribute information acquisition module, used to acquire first to-be-predicted user attribute information of a message sending end and second to-be-predicted user attribute information of a message receiving end, and acquire first historical messages of the message sending end and second historical messages of the message receiving end; A first conversation message determination module, configured to input the first to-be-predicted user attribute information and the first historical message record, the second to-be-predicted user attribute information and the second historical message record into an online conversation generation model, to obtain a first conversation message corresponding to the message sending end; a session message determination module to be sent, configured to score the first session messages based on a preset session recommendation model to obtain a first scoring result, and determine the session message to be sent from the first session messages according to the first scoring result; The session message sending module is used to determine a target session message in response to a selection operation on the session message to be sent, and send the target session message to the message receiving end.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for sending a conversation message according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for sending a session message according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Cited By

  • Session processing method and device, computer equipment and program product

    CN120256591A