Message processing method and device, electronic equipment, medium and program product
By analyzing the matching degree of the emotional attributes of messages and session information, determining the probability of mis-sending and taking measures to prevent mis-sending, the problem of mis-sending of messages is solved and the accuracy and security of message sending are improved.
Patent Information
- Application Number
- CN202411001244.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-01
AI Technical Summary
Existing technologies are difficult to effectively reduce or avoid mistransmission of messages, leading to information leakage and user distress.
By obtaining the message to be sent by the user and the conversation information with the other party, analyze the matching degree of the emotional attributes of the message and conversation information, determine the probability of mis-delivery of the message, and take measures to prevent mis-delivery when the preset conditions are met, such as prompting the user or limiting send.
It effectively reduces the number of mis-sent messages, avoids information leakage and user distress, and improves the accuracy and security of message sending.
Smart Images

Figure CN118740780A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a message sending and processing method, device, electronic device, medium and program product. Background Art
[0002] Mobile phones and other electronic devices have become an indispensable communication tool in people's daily lives. Users use electronic devices to chat with different contacts or handle daily work affairs almost every day. Due to user misoperation or failure to carefully check the contacts selected for sending, it is inevitable that users will send messages to the wrong recipients, which will not only cause trouble to the other party, but sometimes even cause information leakage. Therefore, how to reduce or avoid the occurrence of such mis-sending of messages has become a technical problem that needs to be solved in the field. Summary of the invention
[0003] The embodiments of the present application provide a message processing method, device, electronic device, medium and program product to solve the problem of how to reduce or avoid the occurrence of mis-sending of messages.
[0004] In a first aspect, an embodiment of the present application provides a message processing method, including:
[0005] Acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user;
[0006] respectively determining a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information;
[0007] Determining a probability of mis-sending the first message according to a matching degree between the first emotion attribute and the second emotion attribute;
[0008] When the mis-sending probability meets a preset condition, the first message is processed to prevent mis-sending.
[0009] Optionally, the respectively determining a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information includes:
[0010] Segmenting the target information to obtain a first phrase set, wherein the first phrase set includes each phrase in the target information;
[0011] Determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set;
[0012] Determining a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each word group in the first word group set;
[0013] The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
[0014] Optionally, determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set includes:
[0015] Determining the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications;
[0016] The emotion weight corresponding to the first word group is determined according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
[0017] Optionally, determining the emotion weight corresponding to the first phrase according to the emotion classification corresponding to the first phrase includes:
[0018] Determine, according to the emotion classification corresponding to the first phrase, an initial emotion weight corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class;
[0019] When the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is increased to obtain the emotion weight corresponding to the first phrase;
[0020] When the emotion classification corresponding to the first phrase is the second category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is lowered to obtain the emotion weight corresponding to the first phrase;
[0021] When the emotion classification corresponding to the first phrase is the third category, or the first phrase is the first phrase in the first phrase set, using the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase;
[0022] The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
[0023] Optionally, determining the target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each phrase in the first phrase set includes at least one of the following:
[0024] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than a first preset threshold, determining that the target emotion attribute is a positive emotion;
[0025] When the sum of the emotion weights corresponding to the various phrases in the first phrase set is less than a second preset threshold, determining that the target emotion attribute is a negative emotion, wherein the second preset threshold is less than the first preset threshold;
[0026] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold, it is determined that the target emotion attribute is a neutral emotion.
[0027] Optionally, before determining the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, the method further includes:
[0028] Obtaining the portrait data of the second user;
[0029] Determining a first mis-sending confidence level according to the keywords in the first message and the portrait data;
[0030] The determining, according to the matching degree between the first emotion attribute and the second emotion attribute, the probability of mis-sending the first message includes:
[0031] The mis-sending probability of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
[0032] Optionally, determining a first mis-sending confidence level according to the keyword in the first message and the portrait data includes:
[0033] Determining a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords;
[0034] The first mis-sending confidence level is determined according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
[0035] Optionally, before determining the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, the method further includes:
[0036] Calculating the correlation between the first message and the first session information;
[0037] The determining, according to the matching degree between the first emotion attribute and the second emotion attribute, the probability of mis-sending the first message includes:
[0038] The probability of mis-sending of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
[0039] In a second aspect, an embodiment of the present application further provides a message processing device, including:
[0040] A first acquisition module, configured to acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user;
[0041] A first determining module, configured to respectively determine a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information;
[0042] A second determination module, configured to determine a probability of mis-sending of the first message according to a matching degree between the first emotion attribute and the second emotion attribute;
[0043] The processing module is used to perform anti-mis-sending processing on the first message when the mis-sending probability meets a preset condition.
[0044] Optionally, the first determining module includes:
[0045] A word segmentation submodule, configured to segment the target information to obtain a first word set, wherein the first word set includes each word in the target information;
[0046] A first determination submodule, configured to determine the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set;
[0047] A second determination submodule, configured to determine a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each phrase in the first phrase set;
[0048] The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
[0049] Optionally, the first determining submodule includes:
[0050] A first determining unit, configured to determine the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications;
[0051] The second determination unit is used to determine the emotion weight corresponding to the first word group according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
[0052] Optionally, the second determining unit includes:
[0053] A first determining subunit is used to determine an initial emotion weight corresponding to the first phrase according to the emotion classification corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class;
[0054] a first adjustment subunit, configured to, when the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, increase the initial emotion weight corresponding to the first phrase according to the word attribute of the second phrase to obtain the emotion weight corresponding to the first phrase;
[0055] a second adjustment subunit, configured to, when the emotion classification corresponding to the first phrase is a second category and the first phrase is not the first phrase in the first phrase set, lower the initial emotion weight corresponding to the first phrase according to the word attribute of the second phrase to obtain the emotion weight corresponding to the first phrase;
[0056] a second determining subunit, configured to use the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase when the emotion classification corresponding to the first phrase is the third category or the first phrase is the first phrase in the first phrase set;
[0057] The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
[0058] Optionally, the second determining submodule includes at least one of the following:
[0059] A third determining unit, configured to determine that the target emotion attribute is a positive emotion when the sum of emotion weights corresponding to each word group in the first word group set is greater than a first preset threshold;
[0060] A fourth determining unit, configured to determine that the target emotion attribute is a negative emotion when the sum of emotion weights corresponding to each word group in the first word group set is less than a second preset threshold, wherein the second preset threshold is less than the first preset threshold;
[0061] The fifth determining unit is configured to determine that the target emotion attribute is a neutral emotion when the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold.
[0062] Optionally, the message processing device further includes:
[0063] A first acquisition module, used to acquire the portrait data of the second user;
[0064] A third determination module, configured to determine a first mis-sending confidence level according to the keywords in the first message and the portrait data;
[0065] The second determination module is used to determine the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
[0066] Optionally, the third determining module includes:
[0067] A third determination submodule is used to determine a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords;
[0068] The fourth determination submodule is used to determine the first mis-sending confidence level according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
[0069] Optionally, the message processing device further includes:
[0070] a calculation module, configured to calculate the correlation between the first message and the first session information;
[0071] The second determination module is used to determine the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
[0072] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the message processing method described above when executing the computer program.
[0073] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the message processing method as described above are implemented.
[0074] In a fifth aspect, an embodiment of the present application provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps in the message processing method as described above.
[0075] In an embodiment of the present application, a first message to be sent from a first user to a second user is obtained, and first conversation information between the first user and the second user is obtained; a first emotional attribute corresponding to the first message and a second emotional attribute corresponding to the first conversation information are determined respectively; the probability of mis-sending of the first message is determined according to the degree of matching between the first emotional attribute and the second emotional attribute; and when the probability of mis-sending meets a preset condition, the first message is processed to prevent mis-sending. In this way, by analyzing whether the emotional attributes of the message to be sent are consistent with the conversation information of the object to which the message is to be sent, the possibility of mis-sending of the message can be judged more accurately, and by taking measures to prevent mis-sending when the possibility of mis-sending is judged to be high, the occurrence of mis-sending of the message can be effectively reduced or avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0077] Figure 1 is a flowchart of a message processing method provided by an embodiment of the present application;
[0078] Figure 2 is a schematic diagram of calculating the conversation emotion weight provided by an embodiment of the present application;
[0079] Figure 3 It is a schematic diagram of a pop-up message mis-sending reminder provided in an embodiment of the present application;
[0080] Figure 4 It is a general architecture diagram of the message processing system provided by the embodiment of the present application;
[0081] Figure 5 is a structural diagram of a message processing device provided in an embodiment of the present application;
[0082] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0084] In order to make the embodiments of the present application clearer, the relevant technical knowledge involved in the embodiments of the present application is first introduced as follows:
[0085] Currently, various real-time communication apps usually only detect sensitive words in sent messages, such as reply content, and do not determine whether the user has sent the message to the wrong person. In actual scenarios, users often send messages to irrelevant people by mistake, or choose the wrong person when replying to comments, which will cause confusion to the other party or even information leakage.
[0086] In response to the above technical problems, the embodiment of the present application provides a solution for preventing mis-sending of messages. Through sentiment analysis of the conversation context, or further combined with conversation context relevance judgment and user portrait analysis, it is determined whether the user has sent the message to the wrong person; if the possibility of mis-sending reaches a certain threshold, the user is prompted whether the message has been sent by mistake before sending the message. This solution can greatly reduce the possibility of mis-sending messages, avoiding unnecessary embarrassment and even the risk of information leakage.
[0087] The message processing method, overall system architecture, device and electronic device provided by the embodiments of the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and their application scenarios.
[0088] See also Figure 1 , Figure 1 is a flowchart of a message processing method provided in an embodiment of the present application, which is executed by an electronic device, such as Figure 1 As shown, the following steps are included:
[0089] Step 101: Obtain a first message to be sent by a first user to a second user, and obtain first conversation information between the first user and the second user.
[0090] In an embodiment of the present application, when a user sends a message, replies to a message, or replies to a comment, etc. to another user, message mis-sending detection can be performed to detect whether there is a possibility that the message sent or the reply content of the current user is mistakenly sent to the wrong recipient, and when it is detected that the possibility of mistaken sending to the wrong recipient is high, measures to prevent mistaken sending, such as mistaken sending reminders or sending restrictions, can be taken.
[0091] In step 101, the above-mentioned obtaining of the first message to be sent by the first user to the second user, and obtaining of the first conversation information between the first user and the second user may be, when receiving an input from the first user to send the first message to the second user, first obtaining the first message, and obtaining of the first conversation information between the first user and the second user, so as to determine the possibility of mis-sending, without immediately responding to transmit the first message, that is, the response may be postponed, and the sending of the first message to the second user may be confirmed after it is determined that the possibility of mis-sending of the message is not high.
[0092] Among them, the first user refers to the message sending object, that is, the user who currently performs the message sending operation; the second user refers to the message sending object, that is, the object to which the first message is sent, and can be, for example, a contact, friend, fan or ordinary user in text messages, instant messaging software, social platforms, etc.
[0093] The first message refers to a specific message that the first user currently intends to send to the second user. For example, the first message can be a regular chat message sent by the first user to the second user, or can be a reply message, message, comment reply, or other message sent by the first user to the second user.
[0094] The first session information may refer to historical session information between the first user and the second user, or may be only recent session information. In some embodiments, it may preferably be the most recent one or several historical session information between the first user and the second user, and the first session information may at least include message content sent by the second user to the first user, such as the content of the most recent message sent by the second user to the first user.
[0095] It should be noted that the first message and the first conversation information include but are not limited to message contents in the form of text, voice, emoticons, links, audio, video, etc.
[0096] In this way, the first message and the first conversation information obtained can be combined into the context of the conversation between the first user and the second user, which can be used as the conversation context. In the subsequent step, through the sentiment analysis of the conversation context of the two users, the possibility of the first user mistakenly sending the first message to the second user can be judged more effectively and accurately, thereby helping to prevent the occurrence of mistaken message sending.
[0097] For example, in a conversation, the last sentence of the other party (second user) and the reply to be sent by the current user (first user) constitute the context of the conversation. The specific scenario can be an instant messaging conversation, a reply on a website or social platform, or an offline message.
[0098] For example, user A and user B have the following conversation:
[0099] A: I'm so glad to see you (the most recent conversation sent by A to B)
[0100] B: I visited a client in the morning and then had a quick meal (the reply message that B sent to A in advance).
[0101] In this scenario, the most recent conversation content "Nice to see you" sent by A to B is the first session information to be obtained in step 101, and the reply message "I visited a client in the morning and then had a quick meal" sent by B to A is the first message to be obtained in step 101.
[0102] Step 102: Determine a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information respectively.
[0103] In step 102, sentiment analysis can be performed on the obtained first message and first conversation information respectively to determine the emotional attributes of the two conversation contents. The subsequent steps can determine the probability of mis-sending of the first message by judging whether the emotional attributes of the two conversation contents are consistent, such as calculating the degree of match between the two. If the probability of mis-sending is high, it is judged that the possibility of mis-sending is high, and measures to prevent mis-sending of messages need to be taken. If the probability of mis-sending is low, it is judged that the possibility of mis-sending is low, and measures to prevent mis-sending of messages do not need to be taken. The message can be sent directly in the next step.
[0104] Specifically, the emotional attributes of each conversation can be determined by analyzing the emotions contained in the words or sentences in the conversation content. For example, the emotional attributes of different emotional tendencies can be represented by general attribute classifications such as positive, neutral, and negative, or more fine-grained attribute classifications such as positive, negative, negation, and other can be used to represent the emotional attributes of different emotional states, or they can be converted into emotional attribute values, and different values can be used to represent different emotional attributes.
[0105] Optionally, step 102 includes:
[0106] Segmenting the target information to obtain a first phrase set, wherein the first phrase set includes each phrase in the target information;
[0107] Determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set;
[0108] Determining a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each word group in the first word group set;
[0109] The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
[0110] That is, in some embodiments, both the upper and lower sentences of the conversation can be segmented, the emotion weight of each phrase can be determined, and then the emotion weight of each phrase can be accumulated to determine the emotion attribute of the whole sentence. In other words, the first message and the first conversation information can be respectively determined in this way to determine the corresponding emotion attribute.
[0111] Specifically, the conversation context content can be segmented, and each conversation sentence can be converted into a series of phrases to form a phrase set; then the emotional attributes of each phrase in the conversation sentence are analyzed, such as whether it is a positive word, a negative word, a negative word or a neutral word, and the corresponding emotional weight is determined based on the emotional attributes of each phrase. Specifically, different emotional attributes may correspond to different emotional weights, and the size of the emotional weight is used to represent emotional attributes of different tendencies and degrees; then, by accumulating the emotional weight of each phrase in the conversation sentence, the sum of the emotional weights corresponding to the entire conversation sentence can be determined, and based on the sum of the emotional weights, the emotional attribute of the conversation sentence can be determined, such as judging different emotional attributes according to the interval range into which the sum of the emotional weights of a sentence falls. That is to say, different emotional attributes correspond to emotional weights of different ranges.
[0112] It can be understood that the first conversation information and the first message respectively constitute the context of a conversation, and the above conversation sentences refer to the first message or the first conversation information.
[0113] Through this implementation, the emotional attributes of the entire sentence can be comprehensively determined through fine-grained analysis of the emotional attributes of each phrase in the dialogue sentence. This method can ensure that the emotional attributes of the determined dialogue sentence are relatively accurate and reliable, and this implementation is relatively simple and easy to implement.
[0114] Optionally, determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set includes:
[0115] Determining the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications;
[0116] The emotion weight corresponding to the first word group is determined according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
[0117] In one implementation, the emotion classification corresponding to each phrase can be retrieved through a pre-constructed emotion dictionary, and then the corresponding emotion weight can be assigned or determined according to the emotion classification. Specifically, the corresponding emotion weight can be assigned based on the principle that the more positive the emotion category, the higher the corresponding emotion weight, and the more negative the emotion category, the lower the corresponding emotion weight. Alternatively, the corresponding emotion weight can be determined for each phrase according to the emotion classification according to the emotion weights corresponding to different pre-set emotion classifications.
[0118] The emotion dictionary may set an emotion classification for each phrase, or further set a part of speech, emotion classification and emotion attribute for each phrase. For example, the emotion classification may include categories such as negative, positive, and negative words, and the part of speech may include division by verbs, adjectives, and nouns. The emotion attribute may also be called an emotional tendency, such as positive, negative, and neutral tendencies. Some examples of the content in the emotion dictionary may be shown in Table 1 below:
[0119] Table 1
[0120] Words Part of Speech Emotion Classification Emotional tendency Overwhelmed adj negative Negative Incoherent adj negative Negative Cry v negative Negative Don't v Negative words Negative laughter n positive Positive … … … …
[0121] As can be seen from the above table, by querying the emotion dictionary, the emotion classification corresponding to each phrase in the dialogue sentence can be quickly and accurately determined.
[0122] After determining the emotion classification corresponding to each phrase, the corresponding emotion weight can be further determined based on the emotion classification of the phrase. For example, the emotion weight corresponding to the negative words in the emotion dictionary can be set to -1, the emotion weight corresponding to the positive words in the emotion dictionary can be set to 1, the emotion weight corresponding to the negative words in the emotion dictionary can be set to -1, and the emotion weight corresponding to the neutral words in the emotion dictionary or the neutral words or other words that do not appear in the emotion dictionary can be recorded as 1. In this way, referring to this setting, the corresponding emotion weight can be quickly determined based on the emotion classification of each phrase retrieved.
[0123] Through this implementation, the emotion weight corresponding to each phrase can be determined quickly, accurately and reliably.
[0124] Further, determining the emotion weight corresponding to the first phrase according to the emotion classification corresponding to the first phrase includes:
[0125] Determine, according to the emotion classification corresponding to the first phrase, an initial emotion weight corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class;
[0126] When the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is increased to obtain the emotion weight corresponding to the first phrase;
[0127] When the emotion classification corresponding to the first phrase is the second category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is lowered to obtain the emotion weight corresponding to the first phrase;
[0128] When the emotion classification corresponding to the first phrase is the third category, or the first phrase is the first phrase in the first phrase set, using the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase;
[0129] The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
[0130] In a more specific embodiment, different emotion classifications may have default initial emotion weights, and for each phrase, the final emotion weight may be determined by combining its emotion classification and the word attributes of the previous phrase, such as a modifier. That is, the initial emotion weight of each phrase may be adjusted with reference to the word attributes of the previous phrase to obtain the final emotion weight.
[0131] Specifically, the initial emotion weight corresponding to each phrase can be determined according to the emotion classification corresponding to each phrase, and the relationship between the emotion classification and the initial emotion weight satisfies the principle that the initial emotion weight corresponding to the positive emotion is greater than the initial emotion weight corresponding to the negative emotion. For example, the initial emotion weight corresponding to the positive emotion is 1, and the initial emotion weight corresponding to the negative emotion is -1. Among them, the positive emotion may include positive emotions, and the negative emotion may include negative emotions and negative emotions.
[0132] In this embodiment, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is the emotion classification other than the first category and the second category. Exemplarily, the first category is positive emotions, the second category is negative emotions, and the third category includes negation and other emotions.
[0133] Combine the following Figure 2 An example is used to illustrate the specific method of determining the sentiment weight of a phrase in this embodiment:
[0134] When it is determined that the emotion corresponding to a phrase is classified as negative or other emotions, or there is no word before the phrase, if it is the first phrase in a sentence, its default initial emotion weight can be directly used as the final emotion weight of the phrase. For example, if the emotion classification of the current phrase is negative, its default initial emotion weight -1 is used as the final emotion weight; if the emotion classification of the current phrase is other categories, its default initial emotion weight 1 is used as the final emotion weight.
[0135] When it is determined that the emotion classification corresponding to a certain phrase is positive emotion, and there are words before the phrase, if there is an adverb of degree, the final emotion weight of the phrase can be determined by combining its initial emotion weight and the word attribute of the previous phrase, specifically, adjusting it based on its initial emotion weight according to the word attribute of the previous phrase. For example, if the emotion classification of the previous phrase is consistent with the emotion classification of the current phrase, both of which are positive emotions, then the emotion weight of the current phrase is appropriately increased based on the initial emotion weight; or, if the previous phrase is an adverb of degree, which modifies the positive emotion intensity of the current phrase, then the emotion weight of the current phrase is doubled based on the initial emotion weight; or, if the previous phrase is other word attributes, then the emotion weight of the current phrase is also appropriately increased based on the initial emotion weight.
[0136] When it is determined that the emotion classification corresponding to a certain phrase is negative emotion, and there are words before the phrase, if there is an adverb of degree, the final emotion weight of the phrase can be determined by combining its initial emotion weight and the word attribute of the previous phrase, specifically by adjusting it based on its initial emotion weight according to the word attribute of the previous phrase. For example, if the emotion classification of the previous phrase is consistent with that of the current phrase, both of which are negative emotions, then the emotion weight of the current phrase is appropriately lowered based on the initial emotion weight; or, if the previous phrase is an adverb of degree, which modifies the negative emotion intensity of the current phrase, then the emotion weight of the current phrase is doubled down based on the initial emotion weight; or, if the previous phrase is other word attributes, then the emotion weight of the current phrase is also appropriately lowered based on the initial emotion weight.
[0137] For example, Figure 2 As shown, by querying the negative words in the sentiment dictionary, its corresponding sentiment weight is determined to be -1. If there is a negative word before the word, its sentiment weight is further reduced by 1. If there is a degree adverb before the word, its sentiment weight is doubled to -2.
[0138] By querying the positive words in the sentiment dictionary, the corresponding sentiment weight is determined to be 1. If there is a positive word before the word, its sentiment weight is further increased by 1. If there is an adverb of degree before the word, its sentiment weight is doubled to 2.
[0139] By querying the negative words in the sentiment dictionary, the corresponding sentiment weight is determined to be -1, and the sentiment weights corresponding to neutral words or other words that do not appear in the sentiment dictionary are all recorded as 1.
[0140] Through this implementation, more accurate and reasonable emotion weights can be assigned to each phrase in combination with the relationship between adjacent words, so as to ensure that the emotion weight of the entire sentence can accurately reflect the emotion attribute of the sentence.
[0141] Optionally, determining the target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each phrase in the first phrase set includes at least one of the following:
[0142] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than a first preset threshold, determining that the target emotion attribute is a positive emotion;
[0143] When the sum of the emotion weights corresponding to the various phrases in the first phrase set is less than a second preset threshold, determining that the target emotion attribute is a negative emotion, wherein the second preset threshold is less than the first preset threshold;
[0144] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold, it is determined that the target emotion attribute is a neutral emotion.
[0145] In some embodiments, the emotion weights of each phrase in the dialogue sentence can be accumulated to obtain the emotion weight of the entire dialogue sentence, and compared with preset thresholds of emotion attributes with different tendencies to determine the emotion attribute tendency of the entire dialogue sentence.
[0146] For example, the emotional weight of the entire conversation sentence can be calculated according to the following formula, such as the sentence emotional weight E:
[0147] Sentence sentiment weight E = Σ positive word weight + Σ negative word weight + Σ negative word weight + Σ other word weight
[0148] Among them, Σpositive word weight represents the sum of the sentiment weights of all positive words in the whole dialogue sentence, Σnegative word weight represents the sum of the sentiment weights of all negative words in the whole dialogue sentence, and Σother word weight represents the sum of the sentiment weights of all other words in the whole dialogue sentence except positive words and negative words.
[0149] In this embodiment, the first preset threshold and the second preset threshold can be respectively the positive and negative values of a fixed threshold, or can be respectively different thresholds. For example, the first preset threshold is T and the second preset threshold is -T. In this way, the emotional attribute of the entire conversation sentence, also called the emotional tendency of the sentence, can be determined according to the following conditional formula:
[0150]
[0151] Wherein, T is a preset threshold value, such as 5, 7, 15, etc., which can be adjusted according to actual conditions. It can be understood that in the above formula, T is equivalent to the first preset threshold value, and -T is equivalent to the second preset threshold value.
[0152] Based on the above introduction, for example, when analyzing the emotional attributes of the upper and lower sentences A and B in a conversation, the corresponding emotional attributes Ea and Eb can be calculated in the above manner. If one of Ea and Eb belongs to a negative emotion and the other belongs to a positive emotion, it means that the emotions of the upper and lower sentences are opposite. Therefore, it can be considered that the emotional fluctuation of the conversation is too large, and there is a possibility that the message was sent by mistake. If the emotional tendencies of Ea and Eb are the same or one of them has no emotional tendency, it is considered that the emotions of the conversation are consistent and the possibility of mistaken sending is small.
[0153] Through the implementation mode of the present application, the emotional tendency of the dialogue sentence can be analyzed more accurately based on the sum of the emotional weights of the entire dialogue sentence and the emotional attribute threshold.
[0154] It should be noted that the contextual sentiment analysis in the embodiment of the present application determines whether the emotions of the two parties in the conversation are consistent by identifying the user emotions behind the text of the two parties in the conversation scene. For example, emotions can be roughly divided into three types: positive, neutral, and negative. Positive emotions can be further divided into three types: like, happiness, and gratitude. Negative emotions can be further divided into five types: complain, anger, disgust, fear, and sadness. The remaining emotions are classified as neutral emotions. By analyzing the conversation text through machine learning, the emotion of each sentence of the conversation can be automatically determined.
[0155] The overall process of emotion recognition is as follows: Figure 2 As shown in the figure: the conversation content and context are segmented, the sentences are converted into a series of phrases and a sentiment dictionary is constructed. Each phrase is retrieved through the sentiment dictionary, and the sentiment of each conversation sentence is comprehensively calculated based on the sentiment classification, intensity, part of speech and other attributes of each phrase in the dictionary.
[0156] The emotional dictionary sets the part of speech, emotional classification and emotional tendency attributes for each phrase. The calculation process integrates the emotional weight of the words and calculates the comprehensive emotional value of the whole sentence to judge the emotional attribute of the dialogue sentence. Verbs, adjectives and nouns are divided into three types according to emotional classification: positive, negative and negative words, representing positive and negative emotional tendencies respectively. Combined with the modifiers in the context, the emotional value of the whole sentence, that is, the emotional weight, is calculated comprehensively.
[0157] Step 103: Determine a probability of mis-sending the first message according to a matching degree between the first emotion attribute and the second emotion attribute.
[0158] Specifically, the degree of match between the first emotional attribute and the second emotional attribute can be judged or calculated. Exemplarily, in some embodiments, the first emotional attribute and the second emotional attribute are substantially consistent, such as belonging to the same tendency or category, and the degree of match is determined to be 100%, or 1 is used to indicate a complete match; the first emotional attribute and the second emotional attribute are inconsistent or opposite, such as belonging to opposing tendencies or categories, and the degree of match is determined to be 0%, or 0 is used to indicate a mismatch; the first emotional attribute and the second emotional attribute have similar tendencies, or are not completely opposite, such as belonging to different tendencies but not opposing tendencies or categories, and the degree of match is determined to be 50%, or 0.5 is used to indicate a general degree of match.
[0159] In other embodiments, the first emotion attribute and the second emotion attribute are both represented by attribute values, so that the corresponding matching degree can be determined by comparing the closeness or difference between the emotion attribute values of the two. For example, the closer the attribute values of the first emotion attribute and the second emotion attribute are, the higher the matching degree between the first emotion attribute and the second emotion attribute is; and the greater the difference between the attribute values of the first emotion attribute and the second emotion attribute is, the lower the matching degree between the first emotion attribute and the second emotion attribute is.
[0160] In step 103, the above-mentioned determination of the probability of mis-sending of the first message based on the degree of matching of the first emotional attribute and the second emotional attribute can be determined based on the principle that the degree of matching of the emotional attributes of the context and the probability of mis-sending of the message is negatively correlated. More specifically, it can be determined based on the correspondence between the degree of matching of the emotional attributes of the context and the probability of mis-sending of the message, which is set in advance, or the degree of matching of the emotional attributes can be inversely mapped to the probability of mis-sending of the message through a formula, and then determined based on the formula. The probability of mis-sending can be represented by a specific probability value, or by words such as high, medium, and low, such as using words such as high, medium, and low to represent the size or level of the probability of mis-sending according to the interval range into which the probability of mis-sending falls.
[0161] Exemplarily, the higher the matching degree between the first emotion attribute and the second emotion attribute, the lower the probability of mis-sending of the first message, and the lower the matching degree between the first emotion attribute and the second emotion attribute, the higher the probability of mis-sending of the first message. For another example, if the matching degree between the first emotion attribute and the second emotion attribute is greater than 80%, the probability of mis-sending of the first message is low, if the matching degree between the first emotion attribute and the second emotion attribute is between 50% and 80%, the probability of mis-sending of the first message is medium, and if the matching degree between the first emotion attribute and the second emotion attribute is less than 50%, the probability of mis-sending of the first message is high.
[0162] Optionally, before step 103, the method further includes:
[0163] Calculating the correlation between the first message and the first session information;
[0164] The step 103 comprises:
[0165] The probability of mis-sending of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
[0166] In some embodiments, the possibility of mis-sending of a message may be comprehensively determined from more dimensions in combination with conversation correlation analysis.
[0167] Specifically, the first conversation information and the first message may be used as context to perform a correlation analysis on the content of the conversation, so that the probability of mis-sending of the current first message may be more comprehensively determined by combining the correlation analysis results of the conversation and the degree of matching of the emotional attributes of the conversation.
[0168] In specific implementation, an embedding-based evaluation method can be used, using word vectors and pre-trained language models to encode the context of the conversation separately, and calculate the correlation based on the encoding of the two, such as by scoring to indicate the level of correlation. The main correlation calculation methods include Greedy Matching, Embedding Averaging, and BERT Score.
[0169] In a conversation, the other party's previous sentence and the user's upcoming reply sentence form the context. For example, the context of the conversation is as follows:
[0170] A: I’m so glad to see you.
[0171] B: I visited a client in the morning and then had a quick meal.
[0172] Through the analysis of the conversation content, it can be seen that the relevance of this conversation is low, and user B is likely to have sent the message to A by mistake.
[0173] Another example:
[0174] A: I am very happy today.
[0175] B: Smile happily
[0176] Through the analysis of the conversation content, it can be seen that the relevance of this conversation is relatively high, and the possibility of user B sending a message by mistake is extremely low.
[0177] It should be noted that, in specific implementation, the conversation correlation analysis model can score the correlation between the previous and next sentences of the conversation, and obtain a value C in the interval [0,1] after normalization, which is used for subsequent calculation of the probability of mistransmission.
[0178] When determining the probability of mis-sending of the current first message by integrating the correlation analysis results of the conversation and the matching degree of the conversation emotion attributes, the calculation may be performed by weighting or averaging.
[0179] Through this implementation, it is possible to combine conversation content correlation analysis and conversation emotional attribute analysis to more accurately and comprehensively analyze the probability of message mis-sending, which helps to improve the reliability of subsequent judgment and prevention of message mis-sending, and reduce or avoid the occurrence of misjudgment.
[0180] Optionally, before step 103, the method further includes:
[0181] Obtaining the portrait data of the second user;
[0182] Determining a first mis-sending confidence level according to the keywords in the first message and the portrait data;
[0183] The step 103 comprises:
[0184] The mis-sending probability of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
[0185] In some embodiments, the possibility of message mis-sending can also be comprehensively judged from more dimensions in combination with the user portrait data of the message recipient.
[0186] Specifically, before detecting that the first message needs to be sent to the second user, the portrait data of the second user can be obtained first, wherein the portrait data can specifically include portrait data generated based on the second user's personal information tags, and can also include portrait data related to user preference characteristics generated based on the second user's operational behavior records on instant messaging software or social platforms (which may include published content, chat content, idioms, etc.).
[0187] Next, the confidence level of mis-sending of the first message can be evaluated by analyzing whether the first message contains relevant keywords that are not suitable for the user's portrait features, or by analyzing the matching of the keywords in the first message with the common keywords represented by the second user's portrait data, or with the keywords that are not suitable for receiving represented by the second user's portrait data, based on the second user's portrait data. Exemplarily, the evaluation can be performed based on the principle that the more the number of matches between the keywords in the message content and the keywords that are not suitable for receiving corresponding to the user portrait, the higher the confidence level of mis-sending.
[0188] In actual applications, many systems will create profiles for their respective users and label them with features in order to more accurately push content, provide product services, and perform data statistics. In this embodiment, the user portrait matching module can be used to analyze and calculate the confidence level of the mis-sending of the first message. Specifically, the user portrait matching module infers the mis-sending of the message by analyzing whether the first message is inconsistent with certain features in the recipient's user portrait.
[0189] For example, if a user is marked as a minor, then if the content of the message to be sent contains content that is not suitable for children, it will be considered a mistaken message. If the user is marked as a male, a message recommending the purchase of female cosmetics will be considered a mistaken message.
[0190] Finally, the mis-sending probability of the current first message can be more comprehensively determined by combining the mis-sending confidence and the matching degree of the conversation emotion attribute. The specific implementation method can be to calculate the final mis-sending probability by weighting or averaging the matching degree of the mis-sending confidence and the conversation emotion attribute.
[0191] Through this implementation, it is possible to combine the user portrait analysis and conversation emotional attribute analysis of the message recipient to more accurately and comprehensively judge the probability of message mis-sending, avoid the omission of some mis-sending situations, and further help improve the reliability of subsequent judgment and prevention of message mis-sending.
[0192] Optionally, determining a first mis-sending confidence level according to the keyword in the first message and the portrait data includes:
[0193] Determining a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords;
[0194] The first mis-sending confidence level is determined according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
[0195] In a specific implementation, the correspondence between user portrait tags and non-matching keywords can be recorded by presetting a portrait matching table, wherein non-matching keywords can be understood as keywords that are not suitable for receiving, and can also be called forbidden keywords or blocked words. Therefore, the non-matching keyword set corresponding to the portrait data of the second user can be determined according to the portrait matching table, and then the confidence of message mis-sending can be determined based on the number of non-matching keywords in the non-matching keyword set that the keywords in the message content hit. Specifically, the more non-matching keywords hit, the greater the possibility of message mis-sending, and the higher the corresponding confidence of message mis-sending, wherein the confidence of message mis-sending indicates the degree of credibility of the message being mis-sent.
[0196] In specific implementation, a user portrait matching table can be preset. This table contains keywords that do not match user tags. The operator can configure a non-matching keyword library according to actual business needs. For example, the user portrait matching table can be shown in Table 2 below:
[0197] Table 2
[0198] User Tags Non-matching keywords Minors Alcohol, sleeping pills, Internet cafes, after get off work, at work male Lipstick, eyeshadow, color Highly educated Certificate application, associate degree to bachelor degree, night university … …
[0199] Suppose user B sends a message "Let's go drink together after get off work today" to user A. Then after the message is segmented, the following set of words is obtained:
[0200]
[0201] If user A is marked as a minor, then by looking up the table, it can be seen that the words "off work" and "drinking" in the current message do not match the user, and it is determined that the message may be sent by mistake. During the query process, the more non-matching keywords are hit (expressed as S), the higher the confidence of the message being sent by mistake. Exemplarily, in some embodiments, the confidence of mis-sending, also called non-matching confidence M, can be calculated by the following formula:
[0202]
[0203] In this way, through this implementation, the portrait matching table can be used to quickly determine the number of matches between the keywords in the message content and the non-matching keywords corresponding to the user portrait, thereby accurately evaluating the current message mis-sending confidence from the dimension of the user portrait.
[0204] It should be noted that in some embodiments, in order to fully guarantee the accuracy and reliability of the judgment of mis-sending of messages, the possibility of mis-sending of messages can be comprehensively analyzed and judged in combination with the three dimensions of the above conversation content relevance, emotional attribute consistency, and non-matching confidence corresponding to the user portrait. For example, based on the conversation relevance C, emotional consistency E (that is, the matching degree of the aforementioned emotional attributes), and non-matching confidence M calculated from the above three dimensions, combined with different weights W, the final possibility of mis-sending of the message, that is, the probability of mis-sending, can be calculated according to the following formula:
[0205] P=(1–C)*W1+(1–E)*W2+M*W3
[0206] Among them, W1, W2, and W3 are different weight ratios of various factors, which can be adjusted and set according to actual conditions.
[0207] If the calculated mis-sending probability P is higher than a certain threshold, the user can be prompted before sending the message. If the user confirms that there is no mis-sending, the message can be sent immediately; otherwise, the user can be asked to reselect the recipient.
[0208] Step 104: When the probability of mis-sending meets a preset condition, perform mis-sending prevention processing on the first message.
[0209] In step 104, it can be determined whether the mis-sending probability meets a preset condition according to the mis-sending probability determined in step 103, wherein the preset condition may include that the mis-sending probability is greater than a certain threshold value, such as greater than 80%, or the mis-sending probability belongs to a high level. If it is satisfied, it means that the possibility of mis-sending the first message is very high, and a message mis-sending prevention measure can be taken, that is, the first message can be processed to prevent mis-sending. The mis-sending prevention process can specifically include at least one of the following:
[0210] Output a message error message prompt to remind the user that the message may have been sent to the wrong recipient;
[0211] Restrict the user's message sending operation, such as no longer allowing the user to send the current message or not responding to the user's sending operation on the current message after determining that the message was sent by mistake.
[0212] In this way, it is possible to effectively prevent the first message from being sent to the second user by mistake, thereby avoiding the embarrassment and information leakage risk caused by sending the message to the wrong person.
[0213] Optionally, the performing the error-sending prevention process on the first message includes outputting an error-sending prompt of the message, and the method further includes:
[0214] Upon receiving a confirmation sending operation performed by the first user in response to the output message mistakenly sent prompt, sending the first message to the second user;
[0215] In case of receiving a cancel sending operation performed by the first user in response to the output message mistaken sending prompt, cancel sending the first message to the second user.
[0216] That is, in some embodiments, when it is determined that the possibility of a message being sent by mistake is high, a message mistaken sending prompt may be output, such as Figure 3 As shown, a message mis-sending prompt box 30 is popped up to prompt the user that the message recipient may have been selected by mistake, and the options of confirming sending and canceling sending can be given in the output message mis-sending prompt box 30, so that the first user can confirm whether to continue to send the first message to the second user. If a confirmation sending operation is received, such as the user clicking the confirmation option in the message mis-sending prompt box 30, the current mis-sending prompt can be ignored and the first message can be confirmed to be sent to the second user; if a cancel sending operation is received, such as the user clicking the cancel option in the message mis-sending prompt box 30, it means that the user confirms that this sending operation is a mis-selection behavior, so the sending operation can be canceled and the first message will not be sent to the second user.
[0217] Through this implementation, it is possible to decide whether to continue responding to the user's message sending operation based on the user's feedback operation on the message mis-sending prompt, thereby avoiding the occurrence of message mis-sending as much as possible and ensuring the normal sending of messages in non-mis-sending situations.
[0218] The message processing method of the embodiment of the present application obtains a first message to be sent from a first user to a second user, and obtains first conversation information with the second user; respectively determines a first emotional attribute corresponding to the first message, and a second emotional attribute corresponding to the first conversation information; determines the probability of mis-sending of the first message according to the degree of matching between the first emotional attribute and the second emotional attribute; and performs mis-sending prevention processing on the first message when the mis-sending probability meets a preset condition. In this way, by analyzing whether the emotional attributes of the message to be sent and the conversation information of the object to which the message is to be sent are consistent, the possibility of mis-sending of the message can be more accurately judged, and by taking mis-sending prevention processing measures when it is judged that the possibility of mis-sending is high, the occurrence of mis-sending of the message can be effectively reduced or avoided, and the trouble and information leakage caused to the other party by mis-sending the message can be avoided as much as possible.
[0219] According to the introduction of the above method embodiment, it can be known that the message processing method in the embodiment of the present application can be based on Figure 4 The overall architecture of the system shown in the figure is implemented, including the following major functional modules:
[0220] -Context-related analysis module: Establish a neural network natural language analysis module to analyze the relevance of context through artificial intelligence.
[0221] -Contextual sentiment analysis module: performs sentiment analysis on the text in the context window.
[0222] -User portrait matching module: Create corresponding user portraits for each user in the system.
[0223] - Comprehensive evaluation module: Comprehensively judges whether the current reply belongs to the same conversation by combining context relevance, sentiment analysis results and user portraits.
[0224] - Mistaken message reminder module: If the system believes that the reply content does not belong to the same conversation, it will remind the sender user through visual, auditory and other means to check whether the message was sent by mistake.
[0225] The present application also provides a message processing device. Figure 5 , Figure 5 1 is a structural diagram of a message processing device provided in an embodiment of the present application. Since the principle of solving the problem by the message processing device is similar to that of the message processing method in the embodiment of the present application, the implementation of the message processing device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0226] like Figure 5 As shown, the message processing device 500 includes:
[0227] A first acquisition module 501 is used to acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user;
[0228] A first determining module 502, configured to respectively determine a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information;
[0229] A second determination module 503, configured to determine a probability of mis-sending of the first message according to a matching degree between the first emotion attribute and the second emotion attribute;
[0230] The processing module 504 is used to perform an anti-mis-sending process on the first message when the mis-sending probability meets a preset condition.
[0231] Optionally, the first determining module 502 includes:
[0232] A word segmentation submodule, configured to segment the target information to obtain a first word set, wherein the first word set includes each word in the target information;
[0233] A first determination submodule, configured to determine the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set;
[0234] A second determination submodule, configured to determine a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each phrase in the first phrase set;
[0235] The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
[0236] Optionally, the first determining submodule includes:
[0237] A first determining unit, configured to determine the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications;
[0238] The second determination unit is used to determine the emotion weight corresponding to the first word group according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
[0239] Optionally, the second determining unit includes:
[0240] A first determining subunit is used to determine an initial emotion weight corresponding to the first phrase according to the emotion classification corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class;
[0241] a first adjustment subunit, configured to, when the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, increase the initial emotion weight corresponding to the first phrase according to the word attribute of the second phrase to obtain the emotion weight corresponding to the first phrase;
[0242] a second adjustment subunit, configured to, when the emotion classification corresponding to the first phrase is a second category and the first phrase is not the first phrase in the first phrase set, lower the initial emotion weight corresponding to the first phrase according to the word attribute of the second phrase to obtain the emotion weight corresponding to the first phrase;
[0243] a second determining subunit, configured to use the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase when the emotion classification corresponding to the first phrase is the third category or the first phrase is the first phrase in the first phrase set;
[0244] The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
[0245] Optionally, the second determining submodule includes at least one of the following:
[0246] A third determining unit, configured to determine that the target emotion attribute is a positive emotion when the sum of emotion weights corresponding to each word group in the first word group set is greater than a first preset threshold;
[0247] A fourth determining unit, configured to determine that the target emotion attribute is a negative emotion when the sum of emotion weights corresponding to each word group in the first word group set is less than a second preset threshold, wherein the second preset threshold is less than the first preset threshold;
[0248] The fifth determining unit is configured to determine that the target emotion attribute is a neutral emotion when the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold.
[0249] Optionally, the message processing device 500 further includes:
[0250] A first acquisition module, used to acquire the portrait data of the second user;
[0251] A third determination module, configured to determine a first mis-sending confidence level according to the keywords in the first message and the portrait data;
[0252] The second determination module 503 is used to determine the mis-sending probability of the first message according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
[0253] Optionally, the third determining module includes:
[0254] A third determination submodule is used to determine a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords;
[0255] The fourth determination submodule is used to determine the first mis-sending confidence level according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
[0256] Optionally, the message processing device 500 further includes:
[0257] a calculation module, configured to calculate the correlation between the first message and the first session information;
[0258] The second determination module 503 is used to determine the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
[0259] The message processing device 500 provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0260] The message processing device 500 of the embodiment of the present application obtains a first message to be sent from a first user to a second user, and obtains first conversation information between the first user and the second user; respectively determines a first emotional attribute corresponding to the first message, and a second emotional attribute corresponding to the first conversation information; determines the probability of mis-sending of the first message according to the degree of matching between the first emotional attribute and the second emotional attribute; and performs mis-sending prevention processing on the first message when the mis-sending probability meets a preset condition. In this way, by analyzing whether the emotional attributes of the message to be sent and the conversation information of the object to which the message is to be sent are consistent, the possibility of mis-sending of the message can be judged more accurately, and by taking mis-sending prevention processing measures when it is judged that the possibility of mis-sending is high, the occurrence of mis-sending of the message can be effectively reduced or avoided, and the trouble and information leakage caused to the other party by mis-sending the message can be avoided as much as possible.
[0261] The present application also provides an electronic device. Since the principle of solving the problem by the electronic device is similar to the message processing method in the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 6 As shown, the electronic device of the embodiment of the present application includes: a processor 600, which is used to read the program in the memory 620 and execute the following process:
[0262] Acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user;
[0263] respectively determining a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information;
[0264] Determining a probability of mis-sending the first message according to a matching degree between the first emotion attribute and the second emotion attribute;
[0265] When the mis-sending probability meets a preset condition, the first message is processed to prevent mis-sending.
[0266] The transceiver 610 is configured to receive and send data under the control of the processor 600 .
[0267] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 600 and various circuits of memory represented by memory 620 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations. For different user devices, the user interface 630 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0268] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0269] Segmenting the target information to obtain a first phrase set, wherein the first phrase set includes each phrase in the target information;
[0270] Determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set;
[0271] Determining a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each word group in the first word group set;
[0272] The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
[0273] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0274] Determining the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications;
[0275] The emotion weight corresponding to the first word group is determined according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
[0276] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0277] Determine, according to the emotion classification corresponding to the first phrase, an initial emotion weight corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class;
[0278] When the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is increased to obtain the emotion weight corresponding to the first phrase;
[0279] When the emotion classification corresponding to the first phrase is the second category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is lowered to obtain the emotion weight corresponding to the first phrase;
[0280] When the emotion classification corresponding to the first phrase is the third category, or the first phrase is the first phrase in the first phrase set, using the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase;
[0281] The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
[0282] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute at least one of the following:
[0283] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than a first preset threshold, determining that the target emotion attribute is a positive emotion;
[0284] When the sum of the emotion weights corresponding to the various phrases in the first phrase set is less than a second preset threshold, determining that the target emotion attribute is a negative emotion, wherein the second preset threshold is less than the first preset threshold;
[0285] When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold, it is determined that the target emotion attribute is a neutral emotion.
[0286] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0287] Obtaining the portrait data of the second user;
[0288] Determining a first mis-sending confidence level according to the keywords in the first message and the portrait data;
[0289] The mis-sending probability of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
[0290] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0291] Determining a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords;
[0292] The first mis-sending confidence level is determined according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
[0293] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0294] Calculating the correlation between the first message and the first session information;
[0295] The probability of mis-sending of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
[0296] The electronic device provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0297] In addition, the computer-readable storage medium of the embodiment of the present application is used to store a computer program, and the computer program can be executed by a processor to implement the various steps in the above method embodiment.
[0298] An embodiment of the present application provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the various processes of the message processing method embodiment described above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0299] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0300] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0301] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0302] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A message processing method, It is characterized in that include: Acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user; respectively determining a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information; Determining a probability of mis-sending the first message according to a matching degree between the first emotion attribute and the second emotion attribute; When the mis-sending probability meets a preset condition, the first message is processed to prevent mis-sending.
2. The method according to claim 1, It is characterized in that The respectively determining the first emotion attribute corresponding to the first message and the second emotion attribute corresponding to the first conversation information includes: Segmenting the target information to obtain a first phrase set, wherein the first phrase set includes each phrase in the target information; Determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set; Determining a target emotion attribute corresponding to the target information according to the sum of emotion weights corresponding to each word group in the first word group set; The target information is the first message, and the target emotion attribute is the first emotion attribute; or the target information is the first session information, and the target emotion attribute is the second emotion attribute.
3. The method according to claim 2, It is characterized in that The step of determining the emotion weight corresponding to each phrase in the first phrase set according to the emotion attribute of each phrase in the first phrase set includes: Determining the emotion classification corresponding to each word group in the first word group set by searching an emotion dictionary, wherein the emotion dictionary stores the correspondence between the word groups and the emotion classifications; The emotion weight corresponding to the first word group is determined according to the emotion classification corresponding to the first word group, wherein the first word group is any word group in the first word group set.
4. The method according to claim 3, It is characterized in that The determining the emotion weight corresponding to the first phrase according to the emotion classification corresponding to the first phrase includes: Determine, according to the emotion classification corresponding to the first phrase, an initial emotion weight corresponding to the first phrase, wherein the initial emotion weight corresponding to the phrase whose emotion classification belongs to the positive class is greater than the initial emotion weight corresponding to the phrase whose emotion classification belongs to the negative class; When the emotion classification corresponding to the first phrase is the first category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is increased to obtain the emotion weight corresponding to the first phrase; When the emotion classification corresponding to the first phrase is the second category and the first phrase is not the first phrase in the first phrase set, according to the word attribute of the second phrase, the initial emotion weight corresponding to the first phrase is lowered to obtain the emotion weight corresponding to the first phrase; When the emotion classification corresponding to the first phrase is the third category, or the first phrase is the first phrase in the first phrase set, using the initial emotion weight corresponding to the first phrase as the emotion weight corresponding to the first phrase; The second phrase is the previous phrase adjacent to the first phrase in the first phrase set, the first category and the second category represent positive emotions and negative emotions respectively, and the third category is an emotion classification other than the first category and the second category.
5. The method according to claim 2, It is characterized in that The step of determining the target emotion attribute corresponding to the target information according to the sum of the emotion weights corresponding to the respective phrases in the first phrase set includes at least one of the following: When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than a first preset threshold, determining that the target emotion attribute is a positive emotion; When the sum of the emotion weights corresponding to the various phrases in the first phrase set is less than a second preset threshold, determining that the target emotion attribute is a negative emotion, wherein the second preset threshold is less than the first preset threshold; When the sum of the emotion weights corresponding to the respective phrases in the first phrase set is greater than the second preset threshold and less than the first preset threshold, it is determined that the target emotion attribute is a neutral emotion.
6. The method according to claim 1, It is characterized in that Before determining the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, the method further includes: Obtaining portrait data of the second user; Determining a first mis-sending confidence level according to the keywords in the first message and the portrait data; The determining, according to the matching degree between the first emotion attribute and the second emotion attribute, the probability of mis-sending the first message includes: The mis-sending probability of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute and the first mis-sending confidence.
7. The method according to claim 6, It is characterized in that The determining, according to the keywords in the first message and the portrait data, a first mis-sending confidence level includes: Determining a non-matching keyword set corresponding to the portrait data according to a portrait matching table, wherein the portrait matching table stores a correspondence between portrait tags and non-matching keywords; The first mis-sending confidence level is determined according to the number of matches between the keywords in the first message and the non-matching keywords in the non-matching keyword set.
8. The method according to claim 1, It is characterized in that Before determining the probability of mis-sending of the first message according to the matching degree between the first emotion attribute and the second emotion attribute, the method further includes: Calculating the correlation between the first message and the first session information; The determining, according to the matching degree between the first emotion attribute and the second emotion attribute, the probability of mis-sending the first message includes: The probability of mis-sending of the first message is determined according to the matching degree between the first emotion attribute and the second emotion attribute, and the correlation.
9. A message processing device, It is characterized in that include: A first acquisition module, configured to acquire a first message to be sent by a first user to a second user, and acquire first conversation information between the first user and the second user; A first determining module, configured to respectively determine a first emotion attribute corresponding to the first message and a second emotion attribute corresponding to the first conversation information; A second determination module, configured to determine a probability of mis-sending of the first message according to a matching degree between the first emotion attribute and the second emotion attribute; The processing module is used to perform anti-mis-sending processing on the first message when the mis-sending probability meets a preset condition.
10. An electronic device, include: A transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the message processing method as described in any one of claims 1 to 8.
11. A computer-readable storage medium for storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps in the message processing method according to any one of claims 1 to 8 are implemented.
12. A computer program product, It is characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the message processing method according to any one of claims 1 to 8.
Citation Information
Cited By
Conversation method and device and related equipment
CN120910207A
