A method and device for generating and automatically replying reply information
By obtaining and filtering information that characterizes the reply content and received content, and generating reply information that meets the received content context, the problem of single reply content in the prior art is solved, and more flexible reply content generation is achieved.
Patent Information
- Application Number
- CN201910507001.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2039-06-12
AI Technical Summary
In the prior art, the automatic reply method is relatively single, and targeted reply content cannot be generated based on the different information received.
By obtaining alternative information representing the reply content and information of the currently received content, the relevant reply alternative information that matches the requirements is selected, and reply information that meets the current received content context is generated based on this information.
It realizes the generation of targeted reply content based on the different information received, avoiding the singularity and limitations of reply content, making the reply content more flexible.
Smart Images

Figure CN112084310B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer applications, and more particularly to a method and device for generating reply information. The present application also relates to a method and device for automatically replying to information, and also to a method and device for automatically replying to received emails, as well as a computer storage medium and an electronic device. Background Art
[0002] With the advent of the mobile Internet era, communicating via the Internet has become a norm. Whether at work or in life, electronic information communication has become an important means of communication.
[0003] Generally, the forms of electronic information communication include: email, instant messaging and other methods. When these communication methods receive communication information, they can complete the reply in time by setting an automatic reply method, so as to inform the sender of the status of the information sent. However, the automatic reply method in the prior art usually adopts some pre-configured basic reply words to select the corresponding reply words for automatic reply, that is: after receiving the information sent by the sender, the selected reply words are automatically replied to the sender, wherein the reply words can be, for example, thank you, received, read and other related information; or it can also be based on the reply editing interface provided by the communication system, edit the reply words for the received information, so that the edited reply words are automatically sent after receiving the information, and the edited reply words can be, for example, vacation from a certain date to a certain date and cannot reply in time, reply later in the meeting and other related information.
[0004] Obviously, the reply method in the above-mentioned prior art can only reply to the pre-set or selected reply words, that is, all received messages are replied in the same way, so the reply method is relatively simple and has certain limitations. Summary of the invention
[0005] The present application provides a method for generating reply information to solve the problem in the prior art that the reply content is relatively single and limited when currently receiving communication information.
[0006] The present application provides a method for generating reply information, comprising:
[0007] Obtaining alternative information representing reply content and information representing currently received content;
[0008] Within the range of candidate information representing the reply content, select the relevant candidate reply information that meets the matching requirements with the information of the currently received content;
[0009] Reply information that conforms to the information based on the currently received content is generated according to the information representing the currently received content and the related alternative reply information.
[0010] In some embodiments, the obtaining of candidate information representing the reply content includes:
[0011] Get the preset alternative reply information;
[0012] The candidate reply information is encoded to obtain the candidate information representing the reply content.
[0013] In some embodiments, encoding the candidate reply information to obtain the candidate information representing the reply content includes:
[0014] Perform word segmentation on the candidate reply information to obtain a candidate reply word vector combination;
[0015] According to the combination of alternative reply word vectors, obtain the alternative reply sentence vector representing the reply content;
[0016] The candidate reply sentence vector is determined as the candidate information representing the reply content.
[0017] In some embodiments, the step of obtaining a candidate reply sentence vector representing the reply content according to the candidate reply word vector combination includes:
[0018] Accumulate and sum the word vectors in the candidate reply word vector combination to obtain the cumulative sum result;
[0019] Obtain the average value of the candidate response word vector combination based on the cumulative summation results;
[0020] The average value of the candidate reply word vector combination is determined as the candidate reply sentence vector representing the reply content.
[0021] In some embodiments, it also includes:
[0022] Tag identification information for the candidate response sentence vector and the corresponding candidate response word vector combination;
[0023] The alternative response sentence vectors and alternative response word vectors with identification information are combined and stored.
[0024] In some embodiments, the storing of the candidate reply sentence vector and the candidate reply word vector having the identification information comprises:
[0025] Different recognition information and the corresponding reply sentence vectors and reply word vectors are combined and stored in different storage locations.
[0026] In some embodiments, the acquiring of information representing the currently received content includes:
[0027] Get the text information of the currently received content;
[0028] The text information is encoded to obtain information representing the currently received content.
[0029] In some embodiments, encoding the text information to obtain information representing the currently received content includes:
[0030] Perform word segmentation on the text information to obtain the received word vector combination;
[0031] According to the combination of received word vectors, a received sentence vector representing the current received content is obtained;
[0032] The received sentence vector is determined as information representing the currently received content.
[0033] In some embodiments, the step of obtaining a received sentence vector representing the currently received content according to the received word vector combination includes:
[0034] Accumulate and sum the word vectors in the received word vector combination to obtain an accumulated sum result;
[0035] Obtain the average value of the received word vector combination based on the cumulative summation results;
[0036] The average value of the received word vector combination is determined as the received sentence vector representing the current received content.
[0037] In some embodiments, the step of screening the related candidate reply information that meets the matching requirements with the information of the currently received content within the range of candidate information representing the reply content includes:
[0038] Calculate the similarity between the candidate information of the reply content and the information of the current received content respectively to obtain a similarity result;
[0039] The candidate information of the reply content whose similarity results meet the matching requirements is determined as the relevant reply candidate information.
[0040] In some embodiments, respectively calculating the similarity between the candidate information of the reply content and the information of the currently received content includes:
[0041] Calculate the similarity between the received sentence vector in the information of the current received content and the candidate reply sentence vector in the candidate information representing the reply content to obtain a similarity result;
[0042] The candidate information of the reply content whose similarity results meet the matching requirements is determined as the relevant candidate reply information, including:
[0043] The candidate reply sentence vectors whose similarity results meet the matching requirements are determined as relevant reply sentence vectors;
[0044] According to the relevant reply sentence vectors, the relevant reply word vector combination is obtained.
[0045] In some embodiments, generating reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the related alternative reply information includes:
[0046] Concatenate the related reply word vector combination in the related reply candidate information and the received word vector combination in the information representing the currently received content to obtain a concatenated word vector combination;
[0047] Encode the word vectors in the concatenated word vector combination according to the concatenation order to obtain an encoding result including the hidden states of adjacent word vectors;
[0048] Decode each encoding result to obtain a decoding result;
[0049] Based on the decoding results, generate reply content that conforms to the context of the current received content.
[0050] In some embodiments, encoding the word vectors in the spliced word vector combination in a spliced order to obtain an encoding result including hidden states of adjacent word vectors includes:
[0051] The word vectors in the word vector combination are sequentially input into the sequence network for encoding, and the semantic vector combination result output after encoding is obtained;
[0052] The decoding of the encoding result to obtain the decoding result includes:
[0053] Find a word that has a mapping correspondence relationship with the semantic vector in the semantic vector combination to obtain a decoding result;
[0054] The step of generating reply information in accordance with the information based on the currently received content according to the decoding result includes:
[0055] The found words are concatenated to generate reply information that is consistent with the information based on the currently received content.
[0056] In some embodiments, the step of sequentially inputting the word vectors in the word vector combination into a sequence network for encoding to obtain a semantic vector combination result output after encoding includes:
[0057] Input the word vectors in the word vector combination into the corresponding input neurons in the sequence network in order;
[0058] Determine whether the input word vector is a stop symbol. If so, the input neuron stops receiving the word vector;
[0059] The input neuron that stops receiving the word vector is determined as the first output neuron that outputs the semantic vector, and the first semantic vector of the output is obtained;
[0060] Inputting the first semantic vector and the state information of the first output neuron into the second output neuron to obtain an output second semantic vector;
[0061] The second semantic vector and the state information of the second output neuron are input to the third output neuron to obtain the output third semantic vector. Similarly, when the output semantic vector is a stop symbol, the output semantic vector is stopped to obtain the combination result of the encoded output semantic vector.
[0062] The present application also provides a device for generating reply information, including:
[0063] An acquisition unit, used to acquire candidate information representing reply content and information representing currently received content;
[0064] A screening unit, configured to screen, within the range of candidate information representing the reply content, relevant candidate reply information that meets matching requirements with the information of the currently received content;
[0065] The generating unit is used to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the related reply candidate information.
[0066] The present application also provides a method for automatically replying to information, including:
[0067] Obtaining alternative information representing reply content and information representing currently received content;
[0068] Within the range of candidate information representing the reply content, select the relevant candidate reply information that meets the matching requirements with the information of the currently received content;
[0069] Generate reply information that is consistent with the information based on the currently received content according to the information representing the currently received content and the related reply candidate information;
[0070] Based on the currently received content, a reply message is automatically sent to the sender of the currently received content.
[0071] The present application also provides a device for automatically replying information, including:
[0072] An acquisition unit, used to acquire candidate information representing reply content and information representing currently received content;
[0073] A screening unit, configured to screen, within the range of candidate information representing the reply content, relevant candidate reply information that meets matching requirements with the information of the currently received content;
[0074] A generating unit, configured to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the related candidate reply information;
[0075] The sending unit is used to automatically send the reply information to the sender of the currently received content based on the currently received content.
[0076] The present application also provides a reply method based on received emails, including:
[0077] Obtain information representing the reply content and information representing the content of the currently received email;
[0078] Within the scope of information representing the reply content, select the relevant reply candidate information that meets the matching requirements with the information of the currently received email content;
[0079] Generate reply information that matches the information based on the content of the currently received email according to the information representing the content of the currently received email and the related reply candidate information;
[0080] Based on the content of the currently received email, the reply message is automatically sent to the sender of the email.
[0081] In some embodiments, automatically sending a reply message to the sender of the email based on the content of the currently received email includes:
[0082] When the time of receiving the email content meets the triggering condition of automatic reply, the reply information is automatically sent to the sender of the email.
[0083] The present application also provides an automatic reply method based on receiving instant messaging information, comprising:
[0084] Acquire information representing reply content and information representing currently received instant messaging content;
[0085] Within the scope of information representing the reply content, selecting relevant reply candidate information that meets matching requirements with the information of the currently received instant messaging content;
[0086] Generate reply information that is consistent with the information based on the currently received instant communication content according to the information representing the currently received instant communication content and the related reply candidate information;
[0087] Based on the currently received instant messaging content, a reply message is automatically sent to the sender of the instant messaging content.
[0088] In some embodiments, automatically sending a reply message to the sender of the instant communication content based on the currently received instant communication content includes:
[0089] When the time of currently receiving the instant communication content satisfies the triggering automatic reply condition, the reply information is automatically sent to the sender of the instant communication content.
[0090] The present application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0091] When the program is read and executed, it executes the steps of the reply information generation method as described above; or executes the steps of the automatic reply information method as described above; or executes the steps of the automatic reply method based on receiving emails as described above; or executes the steps of the automatic reply method based on receiving instant messaging information as described above.
[0092] The present application also provides an electronic device, including:
[0093] processor;
[0094] A memory for storing a program for processing data generated by a network platform, wherein when the program is read and executed by the processor, the program executes the steps of the method for generating reply information as described above; or executes the steps of the method for automatically replying to information as described above; or executes the steps of the method for automatically replying based on receiving emails as described above; or executes the steps of the method for automatically replying based on receiving instant messaging information as described above.
[0095] Compared with the prior art, this application has the following advantages:
[0096] The present application provides a method for generating reply information, which obtains alternative information representing reply content and information representing currently received content; within the scope of the alternative information representing the reply content, screens relevant alternative reply information that meets matching requirements with the information of the currently received content; generates reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the relevant alternative reply information; thereby, targeted reply content can be generated according to different received information, avoiding the problem of single reply content, that is, generating corresponding reply content for different received information instead of using preset unified reply content, thereby making the reply content more flexible and avoiding the limitation and singleness of the reply content.
[0097] In addition, the present application provides a method for automatically replying information, which obtains alternative information representing the reply content and information representing the currently received content; within the scope of the alternative information representing the reply content, screens the relevant alternative reply information that meets the matching requirements with the information of the currently received content; generates reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the relevant alternative reply information; based on the currently received content, automatically sends the reply information to the sender of the currently received content. Thus, it is possible to automatically reply to the corresponding reply content related to the email content in a targeted manner according to the received email content. It is possible to automatically process the reply content after receiving the email, and the reply content is generated according to the different information received, avoiding the single problem of the reply content, that is, generating the corresponding reply content for the different information received, instead of using the preset unified reply content, so that the reply content is more flexible and avoids the limitation and singleness of the reply content.
[0098] In addition, the present application provides a reply method based on a received email, by obtaining information representing the reply content and information representing the content of the currently received email; within the range of information representing the reply content, screening the relevant reply candidate information that meets the matching requirements with the information of the currently received email content; generating reply information that meets the information context based on the currently received email content according to the information representing the currently received email content and the relevant reply candidate information; based on the currently received email content, automatically sending the reply information to the sender of the email. Thus, after receiving the email, the reply content related to the email content can be automatically generated according to the email content, and the reply operation can be automatically performed; avoiding the single problem of the reply content, that is, generating corresponding reply content for different received information, instead of using the preset unified reply content, so that the reply content is more flexible and avoids the limitation and singleness of the reply content. In addition, for the automatic reply operation of the email, the reply information can be automatically sent to the sender of the email when the time of the currently received email content meets the triggering automatic reply condition, that is, the reply information is automatically sent only when the receiving time of the received email meets the triggering automatic reply condition, so as to improve the flexibility of sending the automatic reply information.
[0099] The automatic reply method based on receiving instant communication information provided by the present application obtains information representing the reply content and information representing the currently received instant communication content; within the information representing the reply content, selects the relevant reply candidate information that meets the matching requirements with the information of the currently received instant communication content; generates reply information that meets the information context based on the currently received instant communication content according to the information representing the currently received instant communication content and the relevant reply candidate information; based on the currently received instant communication content, automatically sends the reply information to the sender of the instant communication content. Thus, after receiving the instant communication information, the reply content related to the instant communication information can be automatically generated according to the instant communication information, and the reply operation can be automatically performed; avoid the single problem of the reply content, that is, for different instant communication information received, the corresponding reply content is generated instead of using the preset unified reply content, so that the reply content is more flexible and avoids the limitation and singleness of the reply content. In addition, for the automatic reply operation of the instant communication information, the reply information can be automatically sent to the sender of the instant communication information when the time of the current reception of the instant communication information meets the triggering automatic reply condition, that is, the reply information is automatically sent only when the receiving time of the instant communication information meets the triggering automatic reply condition, so as to improve the flexibility of the automatic reply information sending. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] Figure 1 It is a flow chart of an embodiment of a method for generating reply information provided by the present application;
[0101] Figure 2 This is a schematic diagram of the encoding process in a method for generating reply information provided by the present application;
[0102] Figure 3 It is a structural schematic diagram of an embodiment of a device for generating reply information provided by the present application;
[0103] Figure 4 It is a flow chart of an embodiment of a method for automatically replying to information provided by the present application;
[0104] Figure 5 It is a structural diagram of an embodiment of a device for automatically replying information provided by the present application;
[0105] Figure 6 This is a flow chart of an embodiment of a method for automatically replying to received emails provided by the present application;
[0106] Figure 7 This is a flow chart of an embodiment of an automatic reply method based on receiving instant messaging information provided by the present application. DETAILED DESCRIPTION
[0107] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0108] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", are not limitations on quantity or sequence, but are used to distinguish the same type of information from each other.
[0109] Based on the introduction of the background technology of this application, the conventional method for automatic reply is to select preset reply content for unified automatic reply, or to edit the reply content and determine the edited reply content as unified reply content for automatic reply. Regardless of the reply method, unified reply content is used for automatic reply for different received content. Therefore, this method of automatically replying to received content has certain limitations, resulting in a relatively single reply content. The method for generating reply information provided by the present application can generate targeted reply content according to different received information, avoiding the problem of single reply content, that is, different reply content is provided for different received information, thereby making the reply content more flexible and avoiding the limitations of the reply content. Please refer to the following content for the specific process of the generation method.
[0110] Please refer to Figure 1 As shown, Figure 1 : is a flowchart of an embodiment of a method for generating reply information provided by the present application, the generating method comprising:
[0111] Step S101: Acquire candidate information representing reply content and information representing currently received content.
[0112] The step S101 is divided into two parts for description. The first part is to obtain candidate information representing the reply content; the second part is to obtain information representing the currently received content.
[0113] First, the first part, "obtaining alternative information representing the response content", is described.
[0114] To facilitate understanding, the concepts in the step of obtaining the alternative information representing the reply content are first explained:
[0115] The alternative information representing the reply content may refer to alternative information that can be used as the reply content, but the alternative information representing the reply content does not mean to be the reply content for the currently received content. Therefore, the alternative information representing the reply content can be regarded as a kind of alternative reply reference data. The so-called representation can be understood as the reply content or meaning described by the alternative information is the information used for reply or answer, for example: I received it, I will deal with it as soon as possible; or thank you, I will reply later, etc. Then, the method of obtaining the alternative information representing the reply content in step S101 can include:
[0116] Step S101-11: Obtaining preset alternative reply information;
[0117] Among them, the alternative reply information can be the above-mentioned information used to describe the reply content or have the meaning directed to the reply, such as the above-mentioned "Received, I will deal with it as soon as possible"; or "Thank you, reply later"; or "OK, I have received it, thank you" and other corpus information.
[0118] Step S101 - 12: Encode the candidate reply information to obtain the candidate information representing the reply content.
[0119] The specific implementation process of step S101-12 may include:
[0120] Step S101-12-1: Perform word segmentation processing on the candidate reply information to obtain a candidate reply word vector combination;
[0121] Step S101-12-2: Obtaining a candidate reply sentence vector representing the reply content according to the candidate reply word vector combination;
[0122] Step S101-12-3: Determine the candidate reply sentence vector as the candidate information representing the reply content.
[0123] It should be noted that in this embodiment, the alternative reply sentence vectors and alternative reply word vectors can be stored through the storage selection module in the memory network storage architecture, thereby increasing the memory storage capacity, which can also be understood as increasing the storage capacity of alternative reply information.
[0124] The above three steps will be introduced separately below, among which, the word segmentation in step S101-12-1 refers to the division of the candidate reply corpus information sequence into separate words. That is, it is the process of recombining a continuous sequence of characters into a word sequence according to certain specifications; the so-called combination of subsequences can be regarded as a complete sentence. The candidate reply word vector combination in step S101-12-1 can be understood as the combination of separate words obtained after the segmentation of the reply corpus information sequence, that is, the candidate reply word vector combination, for example: [w1, w2, w3, w4, ..., wn], where w1, w2, w3, w4, ..., wn are separate words respectively. According to these separate words and the corresponding word vectors, the candidate reply word vector combination is obtained, for example: [ew1, ew2, ew3, ew4, ..., ewn], where ew1 is the word vector of w1, ew2 is the word vector of w2, ew3 is the word vector of w3, ew4 is the word vector of w4, and ewn is the word vector of wn.
[0125] Existing word segmentation methods can be divided into three categories: word segmentation methods based on string matching, word segmentation methods based on understanding, and word segmentation methods based on statistics. Since word segmentation methods are existing technologies, they are only generally introduced here and will not be elaborated in detail.
[0126] Among them, the commonly used word segmentation methods based on string matching are as follows:
[0127] (1) Forward maximum matching method (from left to right);
[0128] (2) Reverse maximum matching method (from right to left);
[0129] (3) minimum segmentation (the number of words segmented in each sentence is the smallest);
[0130] (4) Bidirectional maximum matching (scanning from left to right and from right to left twice).
[0131] The understanding-based word segmentation method is to achieve the effect of word recognition by simulating human understanding of sentences through computers. Its basic idea is to perform syntactic and semantic analysis while segmenting words, and use syntactic and semantic information to deal with ambiguous phenomena. It usually includes three parts: word segmentation subsystem, syntactic and semantic subsystem, and general control part.
[0132] The statistical word segmentation method is to use a machine learning model to learn the rules of word segmentation (called training) given a large number of segmented texts, so as to segment unknown texts. For example, the maximum probability word segmentation method and the maximum entropy word segmentation method.
[0133] The word segmentation method in step S101-12-1 is not limited to the above content. The purpose of step S101-12-1 is to segment the candidate reply corpus information into words, so as to obtain the candidate reply word vector combination. As for which word segmentation method to choose, it is not the focus.
[0134] The purpose of step S102-12-2 is to obtain a candidate reply sentence vector representing the entire reply content, and the specific implementation process may include:
[0135] The word vectors in the candidate reply word vector combination are accumulated and summed to obtain the accumulated sum result, for example: w1+w2+w3+w4+…+wn;
[0136] The average value of the candidate reply word vector combination is obtained according to the cumulative summation result, that is, the average value EWn of the cumulative summation result is calculated;
[0137] The average value of the candidate reply word vector combination is determined as the candidate reply sentence vector representing the reply content.
[0138] The purpose of step S101-12-3 is to determine the candidate reply sentence vector as information representing a complete sentence of the reply content.
[0139] In order to facilitate the subsequent determination of relevant alternative reply information according to the alternative reply sentence vector, in this embodiment, the following may also be included:
[0140] Combine the candidate reply sentence vector and the corresponding candidate reply word vector with identification information, i.e. (id1, EW1, [ew1, ew2, ew3, …, ewn]);
[0141] The alternative response sentence vectors and alternative response word vectors with identification information are combined and stored.
[0142] It is understandable that there may be multiple candidate reply corpus information, and thus the obtained candidate reply sentence vectors and corresponding candidate reply word vector combinations may also have multiple, therefore, an identification information is added to each candidate reply sentence vector and corresponding candidate reply word vector combination to distinguish it from other candidate information. In other words, the stored information may be a triple including the identification information id, the candidate reply sentence vector and the corresponding candidate reply word vector combination.
[0143] Since there are multiple candidate information, in this embodiment, different recognition information and corresponding reply sentence vectors and reply word vector combinations can be stored in different storage locations. The so-called storage in different storage locations can be stored in different storage locations of the same memory, that is, storage slots, or in storage locations of different memories.
[0144] The above is a detailed description of the first part of step S101, i.e., obtaining the candidate information representing the reply content. In combination with the above content, the second part of step S101, i.e., obtaining the information representing the currently received content, is described as follows:
[0145] Step S101-21: Obtain text information of the currently received content;
[0146] The text information in step S101-21 may refer to the main information or additional information of the currently received content, or the main information and attachment information. For example, for a received email, the text information may be the email body information, that is, the body part may also be called the main information, and the attachment information may be at least one of the subject information and the attachment name information.
[0147] Step S101 - 22 : Encode the text information to obtain information representing the currently received content.
[0148] The encoding process of step S101-22 is similar to the process of step S101-12, and may specifically include:
[0149] Step S101-22-1: Perform word segmentation on the text information to obtain a received word vector combination;
[0150] The word segmentation process in the step S101-22-1 can refer to the description in the above step S101-12-1, which will not be repeated here. In this step, after the text information is segmented, the received word vector combination obtained can be, for example: [w1', w2', w3', w4', ..., wn'], where w1', w2', w3', w4', ..., wn' are separate words. Based on these separate words and the corresponding word vectors, a received word vector combination is obtained, for example: [ew1', ew2', ew3', ew4', ..., ewn']; where ew1' is the word vector of w1', ew2' is the word vector of w2', ew3' is the word vector of w3', ew4' is the word vector of w4', and ewn' is the word vector of wn'.
[0151] Step S101-22-2: Obtain a received sentence vector representing the current received content according to the received word vector combination;
[0152] The specific implementation process of step S101-22-2 is similar to the content of step S101-12-2, that is, it includes:
[0153] Accumulate and sum the word vectors in the received word vector combination to obtain the cumulative sum result, for example: w1'+w2'+w3'+w4'+…+wn';
[0154] The average value of the received word vector combination is obtained according to the cumulative summation result, that is, the average value EWn' of the cumulative summation result is calculated;
[0155] The average value of the received word vector combination is determined as the received sentence vector representing the current received content.
[0156] It should be noted that, in this embodiment, the received sentence vector and the received word vector can be stored by the memory selection module in the memory storage architecture.
[0157] Step S101-22-3: Determine the received sentence vector as information representing the currently received content.
[0158] The purpose of step S101-22-3 is to use the received sentence vector as information representing the complete sentence of the currently received content.
[0159] The above is an explanation of the method of obtaining the alternative information representing the reply content and the information representing the currently received content in step S101. Based on the above content, it can be known that the alternative information representing the reply content may include: alternative reply sentence vectors, alternative reply word vector combinations and identification information; the information representing the currently received content may include: received sentence vectors, received word vector combinations.
[0160] After obtaining the alternative information representing the reply content and the information representing the currently received content, in order to avoid the uniqueness of the reply content in this embodiment, there are multiple alternative information. Therefore, it is necessary to filter out the qualified alternative information from the alternative information as the relevant reply alternative information. Therefore, execute step S102.
[0161] Step S102: within the range of candidate information representing reply content, filter the relevant reply candidate information that meets the matching requirements with the information of the currently received content.
[0162] In step S102, the matching related requirement may be to determine the similarity between the candidate information and the information of the currently received content. The higher the similarity, the greater the degree of similarity between the two, that is, the higher the matching relevance. The specific implementation process of step S102 may include:
[0163] Step S102-1: Calculate the similarity between the candidate information of the reply content and the information of the currently received content to obtain a similarity result;
[0164] The calculation in step S102-1 may refer to calculating the similarity between the candidate information and the information of the currently received content in sequence, and the similarity calculation may be performed using a cosine similarity method. The specific implementation process of step S102-1 may include:
[0165] The similarity between the received sentence vector in the information of the current received content and the alternative reply sentence vector in the alternative information representing the reply content is calculated to obtain the similarity result, that is, the received sentence vector EWn' and the alternative reply sentence vector EW1-EWn are calculated respectively.
[0166] Step S102-2: Determine the candidate information of the reply content whose similarity results meet the matching requirements as the relevant candidate reply information.
[0167] Based on the similarity results obtained in step S102-1, the candidate reply sentence vectors whose similarity results meet the matching requirements are determined as the relevant reply sentence vectors, namely: EWn";
[0168] According to the relevant reply sentence vectors, the relevant reply word vector combination is obtained, that is: [ew1", ew2", ew3", ew4", ..., ewn"]. Since the alternative reply sentence vectors all correspond to their own alternative reply word vector combinations, the relevant reply word vector combination can also be obtained after determining the relevant reply sentence vectors.
[0169] It should be noted that, in this embodiment, satisfying the matching-related requirements may be selecting the maximum value in the similarity calculation results as a condition for satisfying the matching-related requirements, that is, the larger the similarity value, the more similar the meanings expressed by the two are, and the higher the matching degree.
[0170] Step S103: Generate reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the related reply candidate information.
[0171] The purpose of step S103 is to generate reply content for the information of the currently received content, and thus may include:
[0172] Step S103-1: concatenate the related reply word vector combination in the related reply candidate information and the received word vector combination in the information representing the currently received content to obtain a concatenated word vector combination;
[0173] Step S103-2: Encode the word vectors in the concatenated word vector combination in the order of concatenation to obtain a coding result including the hidden states (hidden layer states) of adjacent word vectors; the hidden state serves as the memory of the neural network, storing the data information previously observed by the network, and can be understood as the hidden layer state at the last moment in the encoding process.
[0174] Step S103-3: Decode each encoding result to obtain a decoding result;
[0175] Step S103-4: Generate reply content that conforms to the context of the current received content based on the decoding result.
[0176] Among them, in the step S103-1, the relevant reply word vector combination in the relevant reply alternative information and the received word vector combination in the information representing the currently received content are spliced, which can be understood as, for example: the relevant reply word vector combination [ew1", ew2", ew3", ew4", ...ewn"] is spliced with the received word vector combination [ew1', ew2', ew3', ew4', ..., ewn'], and the splicing result is: [ew1", ew2", ew3", ew4", ..., ewn" ...ew1', ew2', ew3', ew4', ..., ewn'].
[0177] The specific implementation process of step S103-2 can refer to Figure 2 As shown, Figure 2 This is a schematic diagram of the encoding process in a method for generating reply information provided by the present application. The step S103-2 may specifically include:
[0178] Step S103-2-1: inputting the word vectors in the word vector combination into the sequence network in sequence for encoding, and obtaining the semantic vector combination result output after encoding;
[0179] In this embodiment, the specific implementation of encoding by the sequence network RNN (Recurrent Neural Network) may include:
[0180] Step S103-2-11: input the word vectors in the word vector combination into the corresponding input neurons in the sequence network in sequence;
[0181] Step S103-2-12: Determine whether the input word vector is a stop symbol, if so, the input neuron stops receiving the word vector;
[0182] like Figure 2 As shown, in this embodiment, 4 input data are used as an example. When the input data is input into A4, if the input word vector is found to be a stop symbol, the input data to the neuron A4 is stopped. The stop symbol in step S103-2-12 can be understood as a mark such as a period.
[0183] Step S103-2-13: The input neuron that stops receiving the word vector is determined as the first output neuron that outputs the semantic vector, and the output first semantic vector is obtained;
[0184] The first output neuron is A4, and the first semantic vector is W1.
[0185] Step S103-2-14: inputting the first semantic vector and the state information of the first output neuron into the second output neuron to obtain an output second semantic vector;
[0186] The state information of the first output neuron is S4 in A4, and W1 and S4 are input to the second output neuron A5 to obtain the output second semantic vector W2. The state information of the first output neuron is hidden state information.
[0187] Step S103-2-15: Input the second semantic vector and the state information of the second output neuron to the third output neuron to obtain the output third semantic vector. Similarly, when the output semantic vector is a stop symbol, stop outputting the semantic vector to obtain the semantic vector combination result after encoding.
[0188] The state information of the second output neuron is S5 in A5. W2 and S5 are input to the second output neuron A6 to obtain the output third semantic vector W3. And so on. When W5 is a stop symbol, the last output neuron A8 stops outputting the semantic vector to the next output neuron.
[0189] The step S103-3 of decoding each encoding result to obtain a decoding result includes:
[0190] Step S103-3-1: searching for a word that has a mapping correspondence relationship with the semantic vector in the semantic vector combination, and obtaining a decoding result;
[0191] The step S103-4 generates reply information that conforms to the information context based on the currently received content according to the decoding result, including:
[0192] Step S103-4-1: concatenate the found words to generate reply information that conforms to the information context based on the currently received content.
[0193] The above is a specific description of an embodiment of a method for generating reply information provided by the present application. The generation method can generate targeted reply content for the information of the currently received content without adopting preset reply content. That is, the generation method can combine the information of the currently received content with the alternative information of the reply content to generate reply content that better matches the currently received content; thereby avoiding the problem of relatively single reply content when replying to the information of the currently received content.
[0194] It should be noted that in this embodiment, the reply content can be stored in a memory module m (with m i index array) and the following 4 (learned) modules I, G, O, R:
[0195] I (Input Feature Map): Converts the input into an internal feature representation.
[0196] G (Generalization): Updates old memory given new input. It is called generalization because at this stage the network has a chance to compress and generalize its memory for some future need.
[0197] O (output feature map): Given a new input and the current memory state, produce a new output (in feature space).
[0198] R (Reply): Converts the output to a reply in a specific format, such as a text reply or an action.
[0199] Since memory networks are state of the art, they are presented in a general manner.
[0200] Corresponding to the above-mentioned embodiment of a method for generating a reply message, the present application also discloses an embodiment of a device for generating a reply message, please refer to Figure 3 Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0201] like Figure 3 As shown, Figure 3 : is a schematic diagram of a structure of an embodiment of a device for generating reply information provided by the present application, the device comprising:
[0202] An acquisition unit 301 is used to acquire candidate information representing reply content and information representing currently received content;
[0203] The acquisition unit 301 is divided into two parts for description. The first part is to acquire candidate information representing the reply content; the second part is to acquire information representing the currently received content. That is, the acquisition unit 301 may include: a first acquisition unit 301-1 and a second acquisition unit 301-2.
[0204] The first acquisition unit 301-1 is used to acquire candidate information representing the reply content, including:
[0205] The alternative acquisition subunit is used to obtain the preset alternative response corpus information;
[0206] The encoding subunit is used to encode the candidate reply corpus information to obtain the candidate information representing the reply content.
[0207] The encoding subunit includes: a word segmentation processing subunit, an alternative response obtaining subunit and an alternative response determining subunit.
[0208] The word segmentation processing subunit is used to perform word segmentation processing on the candidate reply corpus information to obtain a candidate reply word vector combination;
[0209] The alternative reply obtaining subunit is used to obtain an alternative reply sentence vector representing the reply content according to the alternative reply word vector combination;
[0210] The alternative reply determination subunit is used to determine the alternative reply sentence vector as the alternative information representing the reply content.
[0211] The alternative reply obtaining subunit includes: a first obtaining subunit, a second obtaining subunit and an alternative reply sentence vector determining subunit.
[0212] The first obtaining subunit is used to accumulate and sum the word vectors in the candidate reply word vector combination to obtain an accumulation and summation result;
[0213] The second obtaining subunit is used to obtain an average value of the candidate reply word vector combination according to the cumulative summation result;
[0214] The candidate reply sentence vector determination subunit is used to determine the average value of the candidate reply word vector combination as the candidate reply sentence vector representing the reply content.
[0215] In order to facilitate the subsequent determination of relevant alternative reply information according to the alternative reply sentence vector, in this embodiment, the following may also be included:
[0216] A tagging unit is used to tag identification information for the candidate reply sentence vector and the corresponding candidate reply word vector combination, i.e. (id1, EW1, [ew1, ew2, ew3, …, ewn]);
[0217] The storage unit is used to store the candidate reply sentence vector and the candidate reply word vector with identification information.
[0218] The storage unit includes: a storage allocation subunit, which is used to store different recognition information and corresponding reply sentence vectors and reply word vector combinations in different storage locations.
[0219] The second acquiring unit 301-2 includes:
[0220] A text information acquisition subunit, used to acquire text information of the currently received content;
[0221] The received data obtaining subunit is used to encode the text information to obtain information representing the currently received content.
[0222] The received data obtaining subunit includes: a word segmentation processing subunit, a sentence vector obtaining subunit and a received information determining subunit.
[0223] The word segmentation processing subunit is used to perform word segmentation processing on the text information to obtain a received word vector combination;
[0224] The sentence vector obtaining subunit is used to obtain a received sentence vector representing the currently received content according to the received word vector combination;
[0225] The received information determination subunit is used to determine the received sentence vector as information representing the currently received content.
[0226] The sentence vector obtaining subunit includes: an accumulation subunit, an average value subunit and a received sentence vector determining subunit.
[0227] The accumulation subunit is used to accumulate and sum the word vectors in the received word vector combination to obtain an accumulation and summation result;
[0228] The average value subunit is used to obtain the average value of the received word vector combination according to the cumulative summation result;
[0229] The received sentence vector determination subunit is used to determine the average value of the received word vector combination as the received sentence vector representing the current received content.
[0230] It is understandable that there may be multiple candidate reply corpus information, and thus the obtained candidate reply sentence vectors and corresponding candidate reply word vector combinations may also have multiple, therefore, an identification information is added to each candidate reply sentence vector and corresponding candidate reply word vector combination to distinguish it from other candidate information. In other words, the stored information may be a triple including the identification information id, the candidate reply sentence vector and the corresponding candidate reply word vector combination.
[0231] Since there are multiple candidate information, in this embodiment, different recognition information and corresponding reply sentence vectors and reply word vector combinations can be stored in different storage locations. The so-called storage in different storage locations can be stored in different storage locations of the same memory, that is, storage slots, or in storage locations of different memories.
[0232] A screening unit 302 is used to screen the related candidate reply information that meets the matching requirements with the information of the currently received content within the range of the candidate information representing the reply content;
[0233] The screening unit 302 includes:
[0234] The similarity calculation subunit calculates the similarity between the candidate information of the reply content and the information of the currently received content to obtain a similarity result.
[0235] The relevant alternative determination subunit is used to determine the alternative information of the reply content whose similarity results meet the matching related requirements as relevant reply candidate information.
[0236] The related alternative determination subunit comprises:
[0237] A related sentence vector determination subunit is used to determine the candidate reply sentence vector whose similarity result meets the matching related requirements as the related reply sentence vector;
[0238] The related word vector obtaining subunit is used to obtain a related reply word vector combination based on the related reply sentence vector.
[0239] The generating unit 303 is used to generate reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the related reply candidate information.
[0240] The generating unit 303 includes:
[0241] The splicing and combination obtaining subunit is used to splice the relevant reply word vector combination in the relevant reply candidate information and the received word vector combination in the information representing the currently received content to obtain a spliced word vector combination.
[0242] The encoding subunit is used to encode the word vectors in the concatenated word vector combination according to the concatenation order to obtain an encoding result including the hidden states of adjacent word vectors;
[0243] A decoding subunit, used for decoding each encoding result to obtain a decoding result;
[0244] The reply content generation subunit is used to generate reply content that conforms to the current received content context according to the decoding result.
[0245] The encoding subunit comprises:
[0246] The semantic result acquisition subunit is used to input the word vectors in the word vector combination into the sequence network in sequence for encoding, and obtain the semantic vector combination result output after encoding.
[0247] The decoding subunit comprises:
[0248] The search subunit is used to search for words that have a mapping correspondence relationship with the semantic vectors in the semantic vector combination to obtain a decoding result.
[0249] The reply content generating subunit comprises:
[0250] The splicing subunit is used to splice the found words to generate reply information that conforms to the information context based on the current received content.
[0251] The semantic result obtaining subunit comprises:
[0252] A first input subunit is used to sequentially input the word vectors in the word vector combination into corresponding input neurons in the sequence network;
[0253] The judgment subunit is used to judge whether the input word vector is a stop symbol. If so, the input neuron stops receiving the word vector;
[0254] An output subunit, used to determine the input neuron that stops receiving the word vector as the first output neuron that outputs the semantic vector, and obtain the output first semantic vector;
[0255] A second input subunit is used to input the first semantic vector and the state information of the first output neuron into the second output neuron to obtain an output second semantic vector;
[0256] The third input subunit is used to input the second semantic vector and the state information of the second output neuron into the third output neuron to obtain the output third semantic vector. Similarly, when the output semantic vector is a stop symbol, the output semantic vector is stopped to obtain the semantic vector combination result after encoding.
[0257] The above is a description of an embodiment of a reply information generation device provided in the present application, which is a relatively brief description. For specific contents, please refer to the embodiment of the reply information generation method.
[0258] Based on the above content, this application also provides an embodiment of a method for automatically replying to information, please refer to Figure 4 As shown, Figure 4 This is a flow chart of an embodiment of a method for automatically replying to information provided by the present application, the method comprising:
[0259] Step S401: Acquire candidate information representing reply content and information representing currently received content;
[0260] Step S402: within the range of candidate information representing reply content, select relevant candidate reply information that meets the matching requirements with the information of the currently received content;
[0261] Step S403: generating reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the related reply candidate information;
[0262] Step S404: Based on the currently received content, a reply message is automatically sent to the sender of the currently received content.
[0263] Regarding the method for automatically replying to information, steps S401 to S403 in the embodiment may refer to the above steps S101 to S103.
[0264] The purpose of step S404 is to send the generated reply information and complete the automatic reply.
[0265] Based on the above-mentioned method embodiment of automatically replying information provided by the present application, the present application also provides an embodiment of an apparatus for automatically replying information, such as Figure 5 As shown, Figure 5 : is a schematic diagram of a structure of an embodiment of a device for automatically replying information provided by the present application, the device comprising:
[0266] An acquisition unit 501 is used to acquire candidate information representing reply content and information representing currently received content;
[0267] A screening unit 502 is used to screen the related candidate reply information that meets the matching requirements with the information of the currently received content within the range of the candidate information representing the reply content;
[0268] A generating unit 503, configured to generate reply information that conforms to the information context based on the currently received content according to the information representing the currently received content and the related reply candidate information;
[0269] The sending unit 504 is used to automatically send the reply information to the sender of the currently received content based on the currently received content.
[0270] Based on the above content, this application also provides a method for automatically replying to received emails, please refer to Figure 6 As shown, Figure 6 The present invention is a flowchart of an embodiment of a method for automatically replying to received emails, the method comprising:
[0271] Step S601: Acquire information representing the reply content and information representing the content of the currently received email;
[0272] Step S602: within the information range representing the reply content, select the relevant reply candidate information that meets the matching requirements with the information of the currently received email content;
[0273] Step S603: generating reply information that conforms to the information context based on the content of the currently received email according to the information representing the content of the currently received email and the related reply candidate information;
[0274] Step S604: Based on the content of the currently received email, a reply message is automatically sent to the sender of the email.
[0275] The steps S601 to S603 may refer to the description of the above steps S101 to S103, which will not be repeated here.
[0276] The specific implementation process of step S604 may include:
[0277] Step S604-1: When the time of receiving the current email content satisfies the triggering condition of automatic reply, the reply information is automatically sent to the sender of the email.
[0278] Based on the above content, this application also provides an automatic reply method based on receiving instant messaging information, please refer to Figure 7 As shown, Figure 7 This is a flowchart of an embodiment of an automatic reply method based on receiving instant messaging information provided by the present application, the method comprising:
[0279] Step S701: Acquire information representing the reply content and information representing the currently received instant messaging content;
[0280] Step S702: within the information range representing the reply content, select the relevant reply candidate information that meets the matching requirements with the information of the currently received instant messaging content;
[0281] Step S703: generating reply information that conforms to the information context based on the currently received instant communication content according to the information representing the currently received instant communication content and the related reply candidate information;
[0282] Step S704: Based on the currently received instant messaging content, the reply information is automatically sent to the sender of the instant messaging content.
[0283] Similarly, the steps S701 to S703 may refer to the above steps S101 to S103, and the step S704 may specifically include:
[0284] Step S704-1: When the time of currently receiving the instant communication content satisfies the automatic reply triggering condition, the reply information is automatically sent to the sender of the instant communication content.
[0285] The above are the automatic reply methods in different application scenarios provided by this application. In combination with the above generation method and automatic reply method, this application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0286] When the program is read and executed, it executes the steps of the reply information generation method as described above; or executes the steps of the automatic reply information method as described above; or executes the steps of the automatic reply method based on receiving emails as described above; or executes the steps of the automatic reply method based on receiving instant messaging information as described above.
[0287] Based on the above content, the present application also provides an electronic device, including:
[0288] processor;
[0289] A memory for storing a program for processing data generated by a network platform, wherein when the program is read and executed by the processor, the program executes the steps of the method for generating reply information as described above; or executes the steps of the method for automatically replying to information as described above; or executes the steps of the method for automatically replying based on receiving emails as described above; or executes the steps of the method for automatically replying based on receiving instant messaging information as described above.
[0290] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0291] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0292] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0293] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0294] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A method for generating a reply message, characterized in that: include: Obtaining alternative information representing reply content and information representing currently received content; Within the range of candidate information representing the reply content, select the relevant candidate reply information that meets the matching requirements with the information of the currently received content; Generate reply information that is consistent with the information based on the currently received content according to the information representing the currently received content and the related reply candidate information; The candidate information representing the reply content is vector representation information obtained by encoding the candidate reply information, and the information representing the currently received content is vector representation information obtained by encoding the text information of the currently received content; Among them, the method of generating reply information that conforms to the information based on the currently received content based on the information representing the currently received content and the related reply alternative information includes: determining each word vector in the related reply word vector combination in the related reply alternative information, and each word vector in the received word vector combination in the information representing the currently received content; splicing each word vector in the related reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; and generating reply information that conforms to the information based on the currently received content based on the spliced word vector combination.
2. The method for generating reply information according to claim 1, characterized in that: The step of obtaining the candidate information representing the reply content includes: Get the preset alternative reply information; The candidate reply information is encoded to obtain the candidate information representing the reply content.
3. The method for generating reply information according to claim 2, characterized in that: The encoding process of the candidate reply information to obtain the candidate information representing the reply content includes: Perform word segmentation on the candidate reply information to obtain a candidate reply word vector combination; According to the combination of alternative reply word vectors, obtain the alternative reply sentence vector representing the reply content; The candidate reply sentence vector is determined as the candidate information representing the reply content.
4. The method for generating reply information according to claim 3, characterized in that: The step of obtaining a candidate reply sentence vector representing the reply content according to the candidate reply word vector combination includes: Accumulate and sum the word vectors in the candidate reply word vector combination to obtain the cumulative sum result; Obtain the average value of the candidate response word vector combination based on the cumulative summation results; The average value of the candidate reply word vector combination is determined as the candidate reply sentence vector representing the reply content.
5. The method for generating reply information according to claim 4, characterized in that: Also includes: Tag identification information for the candidate response sentence vector and the corresponding candidate response word vector combination; The alternative response sentence vectors and alternative response word vectors with identification information are combined and stored.
6. The method for generating reply information according to claim 5, characterized in that: The storing of the candidate reply sentence vector and the candidate reply word vector having the identification information comprises: Different recognition information and the corresponding reply sentence vectors and reply word vectors are combined and stored in different storage locations.
7. The method for generating reply information according to claim 2, characterized in that: The obtaining of information representing the currently received content includes: Get the text information of the currently received content; The text information is encoded to obtain information representing the currently received content.
8. The method for generating reply information according to claim 7, characterized in that: The encoding process of the text information to obtain information representing the currently received content includes: Perform word segmentation on the text information to obtain the received word vector combination; According to the combination of received word vectors, a received sentence vector representing the current received content is obtained; The received sentence vector is determined as information representing the currently received content.
9. The method for generating reply information according to claim 8, characterized in that: The step of obtaining a received sentence vector representing the currently received content according to the received word vector combination includes: Accumulate and sum the word vectors in the received word vector combination to obtain an accumulated sum result; Obtain the average value of the received word vector combination based on the cumulative summation results; The average value of the received word vector combination is determined as the received sentence vector representing the current received content.
10. The method for generating reply information according to claim 1, characterized in that: The step of screening the related candidate reply information that meets the matching requirements with the information of the currently received content within the range of candidate information representing the reply content includes: Calculate the similarity between the candidate information of the reply content and the information of the current received content respectively to obtain a similarity result; The candidate information of the reply content whose similarity results meet the matching requirements is determined as the relevant reply candidate information.
11. The method for generating reply information according to claim 10, characterized in that: The respectively calculating the similarity between the candidate information of the reply content and the information of the currently received content includes: Calculate the similarity between the received sentence vector in the information of the current received content and the candidate reply sentence vector in the candidate information representing the reply content to obtain a similarity result; The candidate information of the reply content whose similarity results meet the matching requirements is determined as the relevant candidate reply information, including: The candidate reply sentence vectors whose similarity results meet the matching requirements are determined as relevant reply sentence vectors; According to the relevant reply sentence vectors, the relevant reply word vector combination is obtained.
12. The method for generating reply information according to claim 1, characterized in that: The generating, based on the concatenated word vector combination, reply information that conforms to the information based on the currently received content includes: Encoding the word vectors in the spliced word vector combination according to the splicing order to obtain an encoding result including hidden states of adjacent word vectors; Decode each encoding result to obtain a decoding result; Based on the decoding results, generate reply content that conforms to the context of the current received content.
13. The method for generating reply information according to claim 12, characterized in that: The word vectors in the spliced word vector combination are encoded according to the splicing order to obtain an encoding result including the hidden states of adjacent word vectors, including: The word vectors in the word vector combination are sequentially input into the sequence network for encoding, and the semantic vector combination result output after encoding is obtained; The decoding of the encoding result to obtain the decoding result includes: Find a word that has a mapping correspondence relationship with the semantic vector in the semantic vector combination to obtain a decoding result; The step of generating reply information in accordance with the information based on the currently received content according to the decoding result includes: The found words are concatenated to generate reply information that is consistent with the information based on the currently received content.
14. The method for generating reply information according to claim 13, characterized in that: The word vectors in the word vector combination are sequentially input into the sequence network for encoding to obtain the semantic vector combination result output after encoding, including: Input the word vectors in the word vector combination into the corresponding input neurons in the sequence network in order; Determine whether the input word vector is a stop symbol. If so, the input neuron stops receiving the word vector; The input neuron that stops receiving the word vector is determined as the first output neuron that outputs the semantic vector, and the first semantic vector of the output is obtained; Inputting the first semantic vector and the state information of the first output neuron into the second output neuron to obtain an output second semantic vector; The second semantic vector and the state information of the second output neuron are input to the third output neuron to obtain the output third semantic vector. Similarly, when the output semantic vector is a stop symbol, the output semantic vector is stopped to obtain the combination result of the encoded output semantic vector.
15. A device for generating reply information, characterized in that: include: An acquisition unit, used to acquire candidate information representing reply content and information representing currently received content; A screening unit, configured to screen, within the range of candidate information representing the reply content, relevant candidate reply information that meets matching requirements with the information of the currently received content; A generating unit, configured to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the related candidate reply information; The candidate information representing the reply information is vector representation information obtained by encoding the candidate reply information, and the information representing the currently received content is vector representation information obtained by encoding the text information of the currently received content; Among them, the generation unit is also used to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the relevant reply alternative information through the following steps: determine each word vector in the relevant reply word vector combination in the relevant reply alternative information, and each word vector in the received word vector combination in the information representing the currently received content; splice each word vector in the relevant reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; based on the spliced word vector combination, generate reply information that conforms to the information based on the currently received content.
16. A method for automatically replying to a message, characterized in that: include: Obtaining alternative information representing reply content and information representing currently received content; Within the range of candidate information representing the reply content, select the relevant candidate reply information that meets the matching requirements with the information of the currently received content; Generate reply information that is consistent with the information based on the currently received content according to the information representing the currently received content and the related reply candidate information; Based on the currently received content, the reply message is automatically sent to the sender of the currently received content; The candidate information representing the reply content is vector representation information obtained by encoding the candidate reply information, and the information representing the currently received content is vector representation information obtained by encoding the text information of the currently received content; Among them, the method of generating reply information that conforms to the information based on the currently received content based on the information representing the currently received content and the related reply alternative information includes: determining each word vector in the related reply word vector combination in the related reply alternative information, and each word vector in the received word vector combination in the information representing the currently received content; splicing each word vector in the related reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; and generating reply information that conforms to the information based on the currently received content based on the spliced word vector combination.
17. A device for automatically replying to information, characterized in that: include: An acquisition unit, used to acquire candidate information representing reply content and information representing currently received content; A screening unit, configured to screen, within the range of candidate information representing the reply content, relevant candidate reply information that meets matching requirements with the information of the currently received content; A generating unit, configured to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the related candidate reply information; A sending unit, configured to automatically send a reply message to a sender of the currently received content based on the currently received content; The candidate information representing the reply content is vector representation information obtained by encoding the candidate reply information, and the information representing the currently received content is vector representation information obtained by encoding the text information of the currently received content; Among them, the generation unit is also used to generate reply information that conforms to the information based on the currently received content according to the information representing the currently received content and the relevant reply alternative information through the following steps: determine each word vector in the relevant reply word vector combination in the relevant reply alternative information, and each word vector in the received word vector combination in the information representing the currently received content; splice each word vector in the relevant reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; based on the spliced word vector combination, generate reply information that conforms to the information based on the currently received content.
18. A reply method based on received emails, characterized in that: include: Obtain information representing the reply content and information representing the content of the currently received email; Within the scope of information representing the reply content, select the relevant reply candidate information that meets the matching requirements with the information of the currently received email content; Generate reply information that matches the information based on the content of the currently received email according to the information representing the content of the currently received email and the related reply candidate information; Based on the content of the currently received email, the reply information is automatically sent to the sender of the email; The candidate information representing the reply content is vector representation information obtained by encoding the candidate reply information, and the information representing the content of the currently received email is vector representation information obtained by encoding the text information of the content of the currently received email; Among them, the method of generating reply information that conforms to the information based on the content of the currently received email based on the information representing the content of the currently received email and the related reply alternative information includes: determining each word vector in the related reply word vector combination in the related reply alternative information, and each word vector in the received word vector combination in the information representing the content of the currently received email; splicing each word vector in the related reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; and generating reply information that conforms to the information based on the content of the currently received email based on the spliced word vector combination.
19. The method for replying based on received mail according to claim 18, characterized in that: The method of automatically sending a reply message to the sender of the email based on the content of the currently received email includes: When the time of receiving the email content meets the triggering condition of automatic reply, the reply information is automatically sent to the sender of the email.
20. An automatic reply method based on receiving instant messaging information, characterized in that: include: Acquire information representing reply content and information representing currently received instant messaging content; Within the scope of information representing the reply content, select relevant reply candidate information that meets matching requirements with the information of the currently received instant messaging content; Generate reply information that is consistent with the information based on the currently received instant communication content according to the information representing the currently received instant communication content and the related reply candidate information; Based on the currently received instant messaging content, automatically sending a reply message to the sender of the instant messaging content; The information representing the reply content is vector representation information obtained by encoding the candidate reply information, and the information representing the currently received instant communication content is vector representation information obtained by encoding the text information of the currently received instant communication content; Among them, based on the information representing the currently received instant communication content and the relevant reply alternative information, reply information that is consistent with the information based on the currently received instant communication content is generated, including: determining each word vector in the relevant reply word vector combination in the relevant reply alternative information, and each word vector in the received word vector combination in the information representing the currently received instant communication content; splicing each word vector in the relevant reply word vector combination and each word vector in the received word vector combination in sequence to obtain a spliced word vector combination; based on the spliced word vector combination, generating reply information that is consistent with the information based on the currently received instant communication content.
21. The automatic reply method based on receiving instant messaging information according to claim 20, characterized in that: The method of automatically sending a reply message to a sender of the instant communication content based on the currently received instant communication content includes: When the time of currently receiving the instant communication content satisfies the triggering automatic reply condition, the reply information is automatically sent to the sender of the instant communication content.
22. A computer storage medium for storing data generated by a network platform and a program for processing the data generated by the network platform; When the program is read and executed, it executes the steps of the reply information generation method as described in any one of claims 1 to 14; or executes the steps of the automatic reply information method as described in claim 16; or executes the steps of the automatic reply method based on receiving emails as described in any one of claims 18 to 19; or executes the steps of the automatic reply method based on receiving instant messaging information as described in any one of claims 20 to 21.
23. An electronic device, comprising: processor; A memory for storing a program for processing data generated by a network platform, wherein when the program is read and executed by the processor, the program executes the steps of the method for generating reply information as described in any one of claims 1 to 14; or executes the steps of the method for automatically replying to information as described in claim 16; or executes the steps of the method for automatically replying based on receiving emails as described in any one of claims 18 to 19; or executes the steps of the method for automatically replying based on receiving instant messaging information as described in any one of claims 20 to 21.
Citation Information
Patent Citations
Short text similarity calculating method
CN106484664A
Auxiliary replying method and apparatus of short messages
CN106961513A
Training method of reply message generating model and reply message generating method and device
CN108153913A
Reply information feedback method and device
CN108829896A