Information recommendation method, device and electronic device
Through the hidden layer structure encoding and decoding of the general model, session information, association information and error correction information are generated, which solves the problem of large resource utilization of information recommendation function in the existing input method, and achieves resource conservation and user experience improvement.
Patent Information
- Application Number
- CN201911329943.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-20
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-06-22
AI Technical Summary
The information recommendation function in the existing input method is usually implemented using different models, which leads to large resource consumption and difficult to save, especially when deploying locally or client, where storage space and computing resources are consumed too much.
The general model is adopted, including the hidden layer structure of the encoder and decoder, and information is encoded and decoded by the end hidden layer and the native hidden layer, and session information, associative information and error correction information are generated to reduce the demand for resources.
It realizes that multiple information recommendation functions are provided without deploying multiple information recommendation models, saving resource consumption and improving the efficiency and user experience of the input method.
Smart Images

Figure CN113010023B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an information recommendation method, device and electronic equipment. Background Art
[0002] With the development of computer technology, electronic devices such as mobile phones and tablet computers are becoming more and more popular, bringing great convenience to people's life, study and work. These electronic devices are usually installed with input method applications (input methods for short), so that users can use the input methods to input information.
[0003] The input method provides many information recommendation functions to recommend information to users and improve user input efficiency. For example, the smart reply function recommends the user's conversation information based on the other user's information; another example is the association function: based on the previous information input by the user, it associates the information that the user wants to input next, such as words and sentences.
[0004] However, these different information recommendation functions are usually implemented using different models. For example, the word association function is usually implemented using ngram or language model technology; the smart reply is implemented using a model modeled using chatbot technology. If these models are placed in the cloud, many machines need to be deployed; if the models of these functions are deployed locally, a large amount of storage space on the local device will be occupied. Summary of the invention
[0005] The embodiment of the present invention provides an information recommendation method to save resources.
[0006] Correspondingly, the embodiment of the present invention further provides an information recommendation device and an electronic device to ensure the implementation and application of the above method.
[0007] In order to solve the above problems, an embodiment of the present invention discloses an information recommendation method, which specifically includes: obtaining input information; based on a general model, using the input information to generate and display recommended information; wherein the recommended information includes at least one of the following: conversation information, association information, error correction information and picture expressions.
[0008] Optionally, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0009] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identification.
[0010] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0011] Optionally, after obtaining the associative information corresponding to the input information, generating recommendation information based on the general model using the input information also includes: comparing the associative information with the input information; and generating error correction information corresponding to the input information when the input information does not match the associative information.
[0012] Optionally, the method further includes the step of training the general model: collecting first training data and second training data, wherein the first training data includes multiple groups of dialogue pairs, each group of dialogue pairs includes information with the other end identifier and information with the local end identifier, and the second training data includes multiple sets, each set includes information with the local end identifier; and the general model is trained using the first training data and the second training data respectively.
[0013] Optionally, the use of the first training data to train the general model includes: inputting information with a peer identification in a conversation pair of the first training data into the encoder; the encoder maps the information with a peer identification in the conversation pair to a hidden layer of the peer end for encoding, outputs a peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain corresponding session information; compares the session information with the information with the local end identification in the conversation pair, and reversely trains the general model; wherein the information with the local end identification in the conversation pair corresponds to the information with the peer identification in the conversation pair input into the encoder.
[0014] Optionally, the use of second training data to train the general model includes: inputting the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and reversely trains the general model; wherein N and M are positive integers.
[0015] An embodiment of the present invention also discloses an information recommendation device, which specifically includes: an acquisition module, used to acquire input information; a recommendation module, used to generate and display recommended information based on a general model using the input information; wherein the recommended information includes at least one of the following: conversation information, association information, error correction information and picture expressions.
[0016] Optionally, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0017] Optionally, the recommendation module includes: a session information recommendation submodule, which is used to input the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain the session information corresponding to the input information with the peer identification.
[0018] Optionally, the recommendation module includes: an associative information recommendation submodule, used to input the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0019] Optionally, the recommendation module further includes: an error correction information recommendation submodule, which is used to compare the associative information with the input information after obtaining the associative information corresponding to the input information; when the input information and the associative information do not match, generate error correction information corresponding to the input information.
[0020] Optionally, the device also includes: a collection module, used to collect first training data and second training data, the first training data includes multiple groups of dialogue pairs, each group of dialogue pairs includes information with the other end identification and information with the local end identification, and the second training data includes multiple sets, each set includes information with the local end identification; a training module, used to train the general model using the first training data and the second training data respectively.
[0021] Optionally, the training module includes: a first model training submodule, used to input the information with the opposite end identification in the dialogue pair of the first training data into the encoder; the encoder maps the information with the opposite end identification in the dialogue pair to the opposite end hidden layer for encoding, outputs the opposite end intermediate semantic vector and inputs it into the decoder; the decoder decodes the opposite end intermediate semantic vector to obtain corresponding session information; compares the session information with the information with the local end identification in the dialogue pair, and reversely trains the general model; wherein the information with the local end identification in the dialogue pair corresponds to the information with the opposite end identification in the dialogue pair input into the encoder.
[0022] Optionally, the training module includes: a second model training submodule, used to input the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and performs reverse training on the general model; wherein N and M are positive integers.
[0023] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the information recommendation method as described in any one of the embodiments of the present invention.
[0024] An embodiment of the present invention also discloses an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: obtaining input information; based on a general model, using the input information to generate and display recommendation information; wherein the recommendation information includes at least one of the following: conversation information, associative information, error correction information, and picture expressions.
[0025] Optionally, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0026] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identification.
[0027] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0028] Optionally, after obtaining the associative information corresponding to the input information, generating recommendation information based on the general model using the input information also includes: comparing the associative information with the input information; and generating error correction information corresponding to the input information when the input information does not match the associative information.
[0029] Optionally, the method further includes instructions for performing the following training of the general model: collecting first training data and second training data, the first training data including multiple groups of dialogue pairs, each group of dialogue pairs including information with the other end identifier and information with the local end identifier, the second training data including multiple sets, each set including information with the local end identifier; and using the first training data and the second training data respectively to train the general model.
[0030] Optionally, the use of the first training data to train the general model includes: inputting information with a peer identification in a conversation pair of the first training data into the encoder; the encoder maps the information with a peer identification in the conversation pair to a hidden layer of the peer end for encoding, outputs a peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain corresponding session information; compares the session information with the information with the local end identification in the conversation pair, and reversely trains the general model; wherein the information with the local end identification in the conversation pair corresponds to the information with the peer identification in the conversation pair input into the encoder.
[0031] Optionally, the use of second training data to train the general model includes: inputting the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and reversely trains the general model; wherein N and M are positive integers.
[0032] The embodiments of the present invention include the following advantages:
[0033] In an embodiment of the present invention, user input information can be obtained, and then based on a general model, recommended information can be generated and displayed using the input information, wherein the recommended information includes at least one of the following: session information, association information, and error correction information; thereby, the general model can be used to recommend various information, thereby eliminating the need to install various information recommendation models locally or on the client, thereby saving resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flowchart of steps of an information recommendation method embodiment of the present invention;
[0035] Figure 2a It is a structural schematic diagram of a general model embodiment of the present invention.
[0036] Figure 2b is a flowchart of steps of an embodiment of a general model training method of the present invention;
[0037] Figure 3 is a flowchart of steps of an optional embodiment of an information recommendation method of the present invention;
[0038] Figure 4 is a structural block diagram of an embodiment of an information recommendation device of the present invention;
[0039] Figure 5 is a structural block diagram of an optional embodiment of an information recommendation device of the present invention;
[0040] Figure 6 A structural block diagram of an electronic device for information recommendation according to an exemplary embodiment;
[0041] Figure 7 It is a structural schematic diagram of an electronic device for information recommendation according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] One of the core concepts of the embodiments of the present invention is to generate various recommendation information based on a common model, thereby eliminating the need to install various information recommendation models locally or on the client, thereby saving resources.
[0044] The recommendation information includes at least one of the following: conversation information, association information, error correction information, and picture expressions; of course, other recommendation information may also be included, which is not limited in the embodiment of the present invention.
[0045] Reference Figure 1 , shows a flowchart of an information recommendation method embodiment of the present invention, which may specifically include the following steps:
[0046] Step 102: Obtain input information;
[0047] Step 104: Based on the general model, the input information is used to generate and display recommendation information.
[0048] In an embodiment of the present invention, a general model can be pre-trained so that the trained general model can generate various recommended information, such as association information, conversation information, error correction information, and picture expressions, etc., which are not limited in the embodiment of the present invention. The training process of the general model will be described later. The trained general model can then be deployed on the server side or on the client side, so that the input method can recommend information to the user based on the user's input information.
[0049] During the process of the user using the input method to input, the user's input information can be obtained. The input information may refer to information related to the input, such as local information, peer information, input environment information, etc., which is not limited in the embodiment of the present invention. The input information can then be input into the trained general model, which processes the input information, generates corresponding recommendation information and displays it. The general model can generate only one type of recommendation information, or two or more types of recommendation information, which is not limited in the embodiment of the present invention; thus, it is convenient for users to select according to their own needs.
[0050] In summary, in an embodiment of the present invention, user input information can be obtained, and then based on a general model, the input information can be used to generate and display recommended information, wherein the recommended information includes at least one of the following: conversation information, associative information, error correction information, and picture expressions; and thus a general model can be used to recommend various information, thereby eliminating the need to install various different information recommendation models locally or on the client, thereby saving resources.
[0051] The following is an explanation of the training process of the general model.
[0052] In one example of the present invention, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a hidden layer of the opposite end and a hidden layer of the local end. Figure 2a , the hidden layer of the encoder includes two parts: the opposite end hidden layer 1 and the local end hidden layer 2, wherein 3 is the hidden layer of the decoder. In an example of the present invention, the general model can be a Seq2seq (sequence to sequence) model, and of course it can also be other models, which is not limited in the embodiment of the present invention.
[0053] Reference Figure 2b , shows a flowchart of a general model training method embodiment of the present invention; comprising the following steps:
[0054] Step 202: collect first training data and second training data, wherein the first training data includes multiple groups of dialogue pairs, each group of dialogue pairs includes information with a peer identifier and information with a local identifier, and the second training data includes multiple sets, each set includes information with a local identifier.
[0055] In the embodiment of the present invention, training data can be collected from the entire network, and then the general model can be trained using the collected training data. Since session information is information for interacting with the peer user, such as reply information, question information, etc., and associative information is information that the user may enter next time, the two are different recommended information; therefore, first training data for training the general model to generate session information and second training data for training the general model to generate associative information can be collected.
[0056] In an embodiment of the present invention, a method for collecting the first training data may be to collect multiple groups of dialogue pairs, each of which may include at least one peer information and at least one session information of the local end interacting based on the peer information. Then, a peer identifier is added to the peer information in each group of dialogue pairs, and a local end identifier is added to the session information of the local end, thereby obtaining multiple groups of dialogue pairs including information with the peer identifier and information with the local end identifier; and then the first training data is generated using the multiple groups of dialogue pairs. In each group of dialogue pairs, the peer information and the local end information are arranged in chronological order.
[0057] In an embodiment of the present invention, a method for collecting the second training data may be to collect local information of each user; then divide the local information of each user into multiple sets, and add a local identifier to the local information in each set, and then use multiple sets with local identifiers added to generate the second training data. Among them, multiple consecutive words can be divided into a set, a sentence can be divided into a set, and multiple consecutive sentences can be divided into a set, and the embodiment of the present invention does not limit this. Among them, when a set includes multiple consecutive sentences, the multiple consecutive sentences in the set are arranged in chronological order.
[0058] In an example of the present invention, after collecting the above multiple groups of dialogue pairs, all groups of dialogue pairs can be divided into multiple sets; then the local end identifier is added to the local end information and the opposite end information in each dialogue pair in each set to enrich the second training data.
[0059] Of course, it is also possible to obtain the corresponding input environment information while obtaining each group of dialogue pairs, and then add the input environment information of each group of dialogue pairs to the corresponding group of dialogue pairs, and add the opposite end identifier to the input environment information of each group of dialogue pairs. And when obtaining the local end information of each user, obtain the input environment information of each local end information, and add the input environment information of each local end information to the corresponding set; then add the local end identifier to each input environment information. The input environment information may include multiple types, such as time, environment, weather, etc., which is not limited in the embodiment of the present invention.
[0060] In addition, other information may be obtained as the first training data according to the need to generate session information; and other information may be obtained as the second training data according to the need to generate association information, which is not limited in the embodiment of the present invention.
[0061] Step 204: Use the first training data and the second training data to train the general model respectively.
[0062] The step of training the general model using the first training data may include the following sub-steps:
[0063] Sub-step 22: inputting information with peer identification in the dialogue pair of the first training data into the encoder.
[0064] Sub-step 24, the encoder maps the information with the peer identification in the dialogue pair to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder.
[0065] In an embodiment of the present invention, the information with the opposite end identification in the dialogue pairs of the first training data can be input into the general model so that the general model can predict the conversation information of the local end. Among them, for each group of dialogue pairs, the information with the opposite end identification of the group of dialogue pairs can be input into the encoder of the general model. Then the encoder determines the hidden layer corresponding to the mapping based on the identification of the input information; and then maps the information with the opposite end identification in the group of dialogue pairs to the opposite end hidden layer. After the encoder encodes the information with the opposite end identification of the group of dialogue pairs through the opposite end hidden layer, it outputs the corresponding opposite end intermediate semantic vector; then the opposite end intermediate semantic vector is input into the decoder of the general model, and the decoder outputs the prediction result.
[0066] Sub-step 26: The decoder decodes the peer intermediate semantic vector to obtain corresponding session information.
[0067] Sub-step 28: Compare the session information with the information with the local end identification in the dialogue pair, and reversely train the general model; wherein the information with the local end identification in the dialogue pair corresponds to the information with the other end identification input into the encoder in the dialogue pair.
[0068] After receiving the intermediate semantic vector of the other end, the decoder can use the hidden layer therein to decode the intermediate semantic vector of the other end, and then output the session information. Subsequently, the session information output by the encoder can be compared with the information with the local end identifier in the group of dialogue pairs, and then the parameters of the hidden layer of the decoder and the parameters of the hidden layer of the other end in the encoder can be adjusted through gradient back propagation after multiple training iterations; thereby realizing the use of the first training data to train the general model. Among them, the information with the local end identifier compared with the session information corresponds to the information with the opposite end identifier input into the encoder in the dialogue pair. Among them, the general model can output multiple information fragments, and each information fragment can be spliced according to the output order of each information fragment to obtain the session information. In addition, the decoder of the general model can also output the probability corresponding to each session information while outputting the session information; correspondingly, the training iteration can be performed until the probability of outputting the session information matching the information with the local end identifier in the group of dialogue pairs is maximized.
[0069] When a certain dialogue pair includes peer information and local information, the information with peer identification input to the encoder may refer to peer information. When a certain dialogue pair includes peer information, local information, and input environment information, the information with peer identification input to the encoder may refer to peer information and input environment information.
[0070] In an embodiment of the present invention, when each group of dialogue pairs includes multiple pieces of peer information, each group of dialogue pairs includes the following three situations: The first situation is: neither the peer information nor the local information is continuous, for example: A / B / A / B..., A is the peer information, B is the local information. The second situation is: the peer information is continuous and the local information is not continuous, for example: A / B / AAA / B / A / B... The third situation is: both the peer information and the local information are continuous, for example, A / B / AAA / B / A / BBB... In the process of training the general model, for the first situation, each piece of peer information can be input into the encoder in sequence, and a piece of local information after the peer information is used to compare with the session information output by the decoder. For the second situation, each or more continuous pieces of peer information can be input into the encoder in sequence, and a piece of local information after the peer information is used to compare with the session information output by the decoder. For the third case, each or more continuous peer information may be input into the encoder in sequence, and one or more continuous local information after the peer information may be used to compare with the session information output by the decoder.
[0071] The step of training the general model using the second training data may include the following sub-steps:
[0072] Sub-step 42: input the first N texts in each set of the second training data into the encoder.
[0073] Sub-step 44, the encoder encodes the first N texts to the local hidden layer, outputs the local intermediate semantic vector and inputs it into the decoder.
[0074] In an embodiment of the present invention, the first N texts in each set of the second training data can be input into the general model so that the general model can predict the associative information of the local end; N is a positive integer. Among them, for each set, the first N texts in the set can be input into the encoder of the general model. Then the encoder determines the corresponding mapped hidden layer based on the identification of the information input therein; and then maps the first N texts in the set to the hidden layer of the local end. After the encoder encodes the first N texts in the set through the hidden layer of the local end, it outputs the corresponding intermediate semantic vector of the local end; then the intermediate semantic vector of the local end is input into the decoder of the general model, and the decoder outputs the prediction result.
[0075] Sub-step 46: The decoder decodes the local intermediate semantic vector to obtain corresponding associative information.
[0076] Sub-step 48: Compare the association information with the last M texts corresponding to the first N texts in each set, and perform reverse training on the general model.
[0077] After the decoder receives the intermediate semantic vector of the local end, it can use all the hidden layers therein to decode the intermediate semantic vector of the local end, and then output the associative information. Subsequently, the associative information output by the encoder can be compared with the last M texts in the set, and then the parameters of the hidden layers of the local end in the decoder and encoder can be adjusted through gradient back propagation after multiple training iterations; thereby realizing the training of the general model using the second training data. Wherein, M is a positive integer. Wherein, the general model can output multiple information fragments, and each information fragment can be spliced in the output order of each information fragment to obtain associative information. In addition, the decoder of the general model can output the probability corresponding to each associative information while outputting the associative information; correspondingly, the training iteration can be performed until the probability of outputting the associative information matching the last M texts in the set is maximized.
[0078] In an example of the present invention, for a set including multiple consecutive word divisions, the first N texts may be texts corresponding to the first x words, and the last M texts may be texts corresponding to the last y words, so that the general model can achieve word association; wherein x and y are positive integers. The embodiment of the present invention can use each set to train the general model by taking different values of N, M, x and y respectively.
[0079] In an example of the present invention, for a set containing a sentence, the first N texts may be the first N texts of the sentence, and the last M texts may be the last M texts of the sentence; thereby enabling the general model to implement word association. The embodiment of the present invention can use each set to train the general model by taking different values of N and M respectively.
[0080] For a set containing multiple sentences, in one example of the present invention, the first N texts may be all texts corresponding to the previous local information, and the last M texts may be all texts corresponding to the last local information. In another example of the present invention, the first N texts may be all texts of the first n1 local information, and the last M texts may refer to all texts of the last m1 local information, so that the general model can achieve multi-sentence association, wherein n1 and m1 are both positive integers. In an embodiment of the present invention, each set can be used to train the general model by taking different values of N, M, n1 and m1 respectively. In another example of the present invention, the first N texts may be all texts of the first n2 local information, and the last M texts may refer to all texts of the last local information, so that the general model can achieve multi-sentence association, wherein n2 is a positive integer. In an embodiment of the present invention, each set can be used to train the general model by taking different values of N, M, n1 and m1 respectively. In another example of the present invention, the first N texts may be all texts of the previous local information, and the last M texts may refer to all texts of the last m2 local information, so that the general model can realize multi-sentence association, wherein m2 is a positive integer. In the embodiment of the present invention, each set can be used to train the general model by taking different values of N, M and m2 respectively.
[0081] Of course, the information input to the encoder and the information compared with the recommended information output by the decoder during the subsequent reverse training process can be determined according to the needs of generating session information and the needs of generating associative information. The embodiment of the present invention does not limit this.
[0082] Then the trained general model can be used to recommend information based on the input information, as follows:
[0083] Reference Figure 3 , shows a flowchart of an optional embodiment of an information recommendation method of the present invention, which may specifically include the following steps:
[0084] Step 302: Obtain input information.
[0085] In the embodiment of the present invention, during the user input process, at least one of local end information, peer end information and input environment information may be obtained as input information.
[0086] In an example of the present invention, if the peer information is obtained, the peer identifier can be added to the peer information; if the peer information and input environment information are obtained, or if the local information, input environment information and peer information are obtained, the peer identifier can be added to both the peer information and the input environment information. Then, referring to steps 304 to 308, the trained general model is used to generate session information based on the peer information.
[0087] In another example of the present invention, if local information is obtained, a local identifier can be added to the local information; if local information and input environment information are obtained, a local identifier can be added to both the local information and the input environment information; if local information, input environment information and peer information are obtained, a local identifier can be added to the local information, the input environment information and the peer information. Then, referring to steps 310 to 314, the trained general model is used to generate association information based on the peer information.
[0088] Step 304: Input the input information with the peer identifier to the encoder.
[0089] Step 306: The encoder maps the input information with the peer identifier to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder.
[0090] Step 308: The decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identifier.
[0091] Among them, step 304 to step 308 are similar to the above-mentioned sub-step 22 to sub-step 26, and will not be repeated here.
[0092] After executing step 308, step 320 may be executed.
[0093] Step 310: Input the input information with the local end identifier to the encoder.
[0094] Step 312: The encoder maps the input information with the local end identifier to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder.
[0095] Step 314: The decoder decodes the local intermediate semantic vector to obtain the association information corresponding to the input information with the local identifier.
[0096] Among them, step 310 to step 314 are similar to the above sub-steps 42 to 46, and are not described in detail here. Then, step 320 may be executed.
[0097] In another embodiment of the present invention, the associative information may be used for error correction, so after the general model generates the associative information, after executing step 314, steps 316 to 318 may also be executed.
[0098] Step 316: Compare the associated information with the input information.
[0099] Step 318: When the input information does not match the associative information, generate error correction information corresponding to the input information.
[0100] The associative information can be compared with the input information, and when the input information does not match the associative information, error correction information corresponding to the input information is generated. Among them, the number of texts Q of the associative information can be determined, and the associative information can be compared with the last Q texts of the input information to determine whether the input information matches the associative information. If the last Q texts of the input information match the associative information, it is determined that the input information matches the associative information; at this time, it means that there is no error in the last Q texts of the input information, and no error correction is required. If the last Q texts of the input information do not match the associative information, it is determined that the input information does not match the associative information; at this time, it means that there is an error in the last Q texts of the input information, and error correction is required, so the associative information can be used as the error correction information corresponding to the last Q texts of the input information. Among them, Q is a positive integer.
[0101] Step 320: Display at least one of the following recommended information: session information, association information, and error correction information.
[0102] In the embodiment of the present invention, the recommendation information can be displayed as a candidate item, which can be displayed in the input method keyboard area, such as the candidate bar, the association area, etc., or in a designated area of other applications, which is not limited in the embodiment of the present invention.
[0103] Wherein, when the candidate items are any one of the above-mentioned conversation information, association information and error correction information, the candidate items can be sorted according to the probability of each candidate item output by the general model, and then each candidate item can be displayed according to the sorting result. When the candidate items are two or three of the above-mentioned conversation information, association information and error correction information, the display order of the candidate items corresponding to different types of recommended information can be determined according to a preset order (or a custom order). Wherein, the candidate items corresponding to various types of information can be displayed crosswise, and the candidate items corresponding to another type of recommended information can be displayed after the candidate items of one type of recommended information are fully displayed. The embodiment of the present invention does not limit this.
[0104] Among them, after the error correction information is determined, the erroneous text in the information input by the user can be marked in the edit box while displaying the error correction information to remind the user of the input error and facilitate the user to correct the erroneous text.
[0105] In summary, in an embodiment of the present invention, user input information can be obtained, and then based on a general model, the input information can be used to generate and display recommended information, wherein the recommended information includes at least one of the following: session information, associative information, and error correction information; and thus a general model can be used to recommend various information, thereby eliminating the need to install various different information recommendation models locally or on the client, thereby saving resources.
[0106] Secondly, in an embodiment of the present invention, after using a general model to generate associative information based on the input information, the associative information can also be compared with the input information; when the input information does not match the associative information, error correction information corresponding to the input information is generated; and thus the information input by the user can be corrected, thereby improving the efficiency of user error correction.
[0107] Again, in an embodiment of the present invention, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer; then, in the process of generating recommendation information based on the general model using the input information, the input information with the peer identification is mapped to the peer hidden layer for encoding by the encoder, and then the session information is output by the decoder, and the input information with the local identification is mapped to the local hidden layer for encoding, and then the decoder outputs the associative information; and then, through the processing of different hidden layers of the encoder, different types of recommendation information can be accurately generated.
[0108] In an optional embodiment of the present invention, the associative information can also be used to recommend picture expressions. After determining the associative information corresponding to the input information based on the general model, the associative information can be matched with the label of the picture expression to find the label matching the associative information. Then, the picture expression corresponding to the label matching the associative information is selected and displayed; and the recommendation of the picture expression is realized through the general model.
[0109] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0110] Reference Figure 4 , shows a structural block diagram of an information recommendation device embodiment of the present invention, which may specifically include the following modules:
[0111] The acquisition module 402 is used to acquire input information;
[0112] The recommendation module 404 is used to generate and display recommendation information based on the general model using the input information; wherein the recommendation information includes at least one of the following: conversation information, association information, error correction information and picture expressions.
[0113] Reference Figure 5 , shows a structural block diagram of an optional embodiment of an information recommendation device of the present invention.
[0114] In an optional embodiment of the present invention, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0115] In an optional embodiment of the present invention, the recommendation module 404 includes:
[0116] The session information recommendation submodule 4042 is used to input the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain the session information corresponding to the input information with the peer identification.
[0117] In an optional embodiment of the present invention, the recommendation module 404 includes:
[0118] The associative information recommendation submodule 4044 is used to input the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0119] In an optional embodiment of the present invention, the recommendation module 404 further includes:
[0120] The error correction information recommendation submodule 4046 is used to compare the associative information with the input information after obtaining the associative information corresponding to the input information; when the input information and the associative information do not match, generate error correction information corresponding to the input information.
[0121] In an optional embodiment of the present invention, the device further comprises:
[0122] A collecting module 406, configured to collect first training data and second training data, wherein the first training data includes a plurality of dialogue pairs, each dialogue pair includes information with a peer end identifier and information with a local end identifier, and the second training data includes a plurality of sets, each set includes information with a local end identifier;
[0123] The training module 408 is used to train the general model using the first training data and the second training data respectively.
[0124] In an optional embodiment of the present invention, the training module 408 includes:
[0125] The first model training submodule 4082 is used to input the information with the opposite end identification in the dialogue pair of the first training data into the encoder; the encoder maps the information with the opposite end identification in the dialogue pair to the opposite end hidden layer for encoding, outputs the opposite end intermediate semantic vector and inputs it into the decoder; the decoder decodes the opposite end intermediate semantic vector to obtain the corresponding session information; compares the session information with the information with the local end identification in the dialogue pair, and reversely trains the general model; wherein the information with the local end identification in the dialogue pair corresponds to the information with the opposite end identification in the dialogue pair input into the encoder.
[0126] In an optional embodiment of the present invention, the training module 408 includes:
[0127] The second model training submodule 4084 is used to input the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and reversely trains the general model; wherein N and M are positive integers.
[0128] In summary, in an embodiment of the present invention, user input information can be obtained, and then based on a general model, the input information can be used to generate and display recommended information, wherein the recommended information includes at least one of the following: conversation information, associative information, error correction information, and picture expressions; and thus a general model can be used to recommend various information, thereby eliminating the need to install various different information recommendation models locally or on the client, thereby saving resources.
[0129] As for the device embodiment, since it 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.
[0130] Figure 6 1 is a block diagram of an electronic device 600 for information recommendation according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0131] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0132] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0133] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0134] The power component 606 provides power to the various components of the electronic device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0135] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0136] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0137] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0138] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0139] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 614 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 614 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0140] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0141] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0142] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform an information recommendation method, the method comprising: obtaining input information; based on a general model, using the input information to generate and display recommended information; wherein the recommended information comprises at least one of the following: conversation information, associative information, error correction information, and picture expressions.
[0143] Optionally, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0144] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identification.
[0145] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0146] Optionally, after obtaining the associative information corresponding to the input information, generating recommendation information based on the general model using the input information also includes: comparing the associative information with the input information; and generating error correction information corresponding to the input information when the input information does not match the associative information.
[0147] Optionally, the method further includes the step of training the general model: collecting first training data and second training data, wherein the first training data includes multiple groups of dialogue pairs, each group of dialogue pairs includes information with the other end identifier and information with the local end identifier, and the second training data includes multiple sets, each set includes information with the local end identifier; and the general model is trained using the first training data and the second training data respectively.
[0148] Optionally, the use of the first training data to train the general model includes: inputting information with a peer identification in a conversation pair of the first training data into the encoder; the encoder maps the information with a peer identification in the conversation pair to a hidden layer of the peer end for encoding, outputs a peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain corresponding session information; compares the session information with the information with the local end identification in the conversation pair, and reversely trains the general model; wherein the information with the local end identification in the conversation pair corresponds to the information with the peer identification in the conversation pair input into the encoder.
[0149] Optionally, the use of second training data to train the general model includes: inputting the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and reversely trains the general model; wherein N and M are positive integers.
[0150] Figure 7: is a structural diagram of an electronic device 700 for information recommendation according to another exemplary embodiment of the present invention. The electronic device 700 may be a server, which may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 722 (for example, one or more processors) and a memory 732, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 742 or data 744. Among them, the memory 732 and the storage medium 730 may be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processor 722 may be configured to communicate with the storage medium 730 and execute a series of instruction operations in the storage medium 730 on the server.
[0151] The server may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, one or more keyboards 756, and / or one or more operating systems 741, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0152] An electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: obtaining input information; based on a general model, using the input information to generate and display recommendation information; wherein the recommendation information includes at least one of the following: conversation information, association information, error correction information, and picture expressions.
[0153] Optionally, the general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a peer hidden layer and a local hidden layer.
[0154] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the peer identification into the encoder; the encoder maps the input information with the peer identification to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identification.
[0155] Optionally, the general model-based method uses the input information to generate recommendation information, including: inputting the input information with the local end identification into the encoder; the encoder maps the input information with the local end identification to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; the decoder decodes the local end intermediate semantic vector to obtain the associative information corresponding to the input information with the local end identification.
[0156] Optionally, after obtaining the associative information corresponding to the input information, generating recommendation information based on the general model using the input information also includes: comparing the associative information with the input information; and generating error correction information corresponding to the input information when the input information does not match the associative information.
[0157] Optionally, the method further includes instructions for performing the following training of the general model: collecting first training data and second training data, the first training data including multiple groups of dialogue pairs, each group of dialogue pairs including information with the other end identifier and information with the local end identifier, the second training data including multiple sets, each set including information with the local end identifier; and using the first training data and the second training data respectively to train the general model.
[0158] Optionally, the use of the first training data to train the general model includes: inputting information with a peer identification in a conversation pair of the first training data into the encoder; the encoder maps the information with a peer identification in the conversation pair to a hidden layer of the peer end for encoding, outputs a peer intermediate semantic vector and inputs it into the decoder; the decoder decodes the peer intermediate semantic vector to obtain corresponding session information; compares the session information with the information with the local end identification in the conversation pair, and reversely trains the general model; wherein the information with the local end identification in the conversation pair corresponds to the information with the peer identification in the conversation pair input into the encoder.
[0159] Optionally, the use of second training data to train the general model includes: inputting the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the hidden layer of the local end for encoding, outputs the intermediate semantic vector of the local end and inputs it into the decoder; the decoder decodes the intermediate semantic vector of the local end to obtain corresponding associative information; compares the associative information with the last M texts corresponding to the first N texts in the set, and reversely trains the general model; wherein N and M are positive integers.
[0160] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0161] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0164] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0165] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0166] The above is a detailed introduction to an information recommendation method, an information recommendation device and an electronic device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An information recommendation method, characterized in that: include: Get input information; Based on the general model, the input information is used to generate and display recommendation information; The recommendation information includes at least one of the following: conversation information, association information, error correction information, and picture expressions; The general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a hidden layer of the opposite end and a hidden layer of the local end; The step of generating recommendation information based on the general model and using the input information includes: Inputting input information with a peer identifier into the encoder; The encoder maps the input information with the peer identifier to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; The decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identifier; The step of generating recommendation information based on the general model and using the input information includes: Inputting input information with a local end identifier into the encoder; The encoder maps the input information with the local end identifier to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; The decoder decodes the local intermediate semantic vector to obtain the association information corresponding to the input information with the local identifier.
2. The method according to claim 1, characterized in that After obtaining the association information corresponding to the input information, generating recommendation information based on the general model using the input information further includes: Comparing the associated information with the input information; When the input information does not match the associative information, error correction information corresponding to the input information is generated.
3. The method according to claim 1, characterized in that Also included is the step of training the general model: Collecting first training data and second training data, the first training data including a plurality of dialogue pairs, each dialogue pair including information with a peer end identifier and information with a local end identifier, and the second training data including a plurality of sets, each set including information with a local end identifier; The general model is trained using the first training data and the second training data respectively.
4. The method according to claim 3, characterized in that The adopting the first training data to train the general model comprises: Inputting information with a peer identifier in a conversation pair of the first training data into the encoder; The encoder maps the information with the peer identification in the dialogue pair to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; The decoder decodes the peer intermediate semantic vector to obtain corresponding session information; The session information is compared with the information with the local end identification in the dialogue pair, and the general model is reversely trained; wherein the information with the local end identification in the dialogue pair corresponds to the information with the opposite end identification in the dialogue pair input into the encoder.
5. The method according to claim 3, characterized in that: The adopting the second training data to train the general model comprises: Inputting the first N texts in the set of the second training data into the encoder; the encoder maps the first N texts to the local hidden layer for encoding, outputs the local intermediate semantic vector and inputs it into the decoder; The decoder decodes the local intermediate semantic vector to obtain corresponding associative information; Compare the association information with the last M texts corresponding to the first N texts in the set, and perform reverse training on the general model; Wherein, N and M are positive integers.
6. An information recommendation device, characterized in that: include: An acquisition module is used to obtain input information; A recommendation module, used to generate and display recommendation information based on the general model and the input information; The recommended information includes at least one of the following: conversation information, association information, error correction information, and picture emoticons. The general model includes an encoder and a decoder connected to the encoder, and the hidden layer of the encoder includes: a hidden layer of the opposite end and a hidden layer of the local end; The recommendation module includes: a session information recommendation submodule, which is used to input input information with a peer identifier into the encoder; The encoder maps the input information with the peer identifier to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; The decoder decodes the peer intermediate semantic vector to obtain session information corresponding to the input information with the peer identifier; The recommendation module includes: an associative information recommendation submodule, which is used to input the input information with the local end identification into the encoder; The encoder maps the input information with the local end identifier to the local end hidden layer for encoding, outputs the local end intermediate semantic vector and inputs it into the decoder; The decoder decodes the local intermediate semantic vector to obtain the association information corresponding to the input information with the local identifier.
7. The device according to claim 6, characterized in that The recommendation module further includes: An error correction information recommendation submodule, configured to compare the associated information with the input information after obtaining the associated information corresponding to the input information; When the input information does not match the associative information, error correction information corresponding to the input information is generated.
8. The device according to claim 6, characterized in that The device also includes: a collecting module, configured to collect first training data and second training data, wherein the first training data includes a plurality of dialogue pairs, each dialogue pair includes information with a peer end identifier and information with a local end identifier, and the second training data includes a plurality of sets, each set includes information with a local end identifier; A training module is used to train the general model using the first training data and the second training data respectively.
9. The device according to claim 8, characterized in that The training module comprises: A first model training submodule, configured to input information having a peer identifier in a conversation pair of the first training data into the encoder; The encoder maps the information with the peer identification in the dialogue pair to the peer hidden layer for encoding, outputs the peer intermediate semantic vector and inputs it into the decoder; The decoder decodes the peer intermediate semantic vector to obtain corresponding session information; Comparing the session information with the information with the local end identifier in the dialogue pair, and performing reverse training on the general model; The information with the local end identifier in the dialogue pair corresponds to the information with the opposite end identifier input into the encoder in the dialogue pair.
10. The device according to claim 8, characterized in that The training module comprises: a second model training submodule, configured to input the first N texts in the set of the second training data into the encoder; The encoder maps the first N texts to the local hidden layer for encoding, outputs the local intermediate semantic vector and inputs it into the decoder; The decoder decodes the local intermediate semantic vector to obtain corresponding associative information; Compare the association information with the last M texts corresponding to the first N texts in the set, and perform reverse training on the general model; Wherein, N and M are positive integers.
11. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the information recommendation method as described in any one of method claims 1-5.
12. An electronic device, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include the method for performing the information recommendation method as described in any one of method claims 1-5.
