A data processing method, a data processing device and a data processing device
By determining the above text of the information to be replied in a conversation scenario and generating the reply candidate using a machine learning model, the problem of low accuracy of reply candidates in the prior art is solved, and the accuracy of reply candidates is significantly improved.
Patent Information
- Application Number
- CN201810835658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2039-04-03
AI Technical Summary
The prior art generates reply candidates in dialogue scenarios with low accuracy and cannot effectively reflect the reply intention of the information to be replied.
By determining the information to be replied and its above, the response candidates are generated using machine learning models and natural language processing techniques to improve the correlation between candidates and response intentions.
The correlation between the reply candidate and the reply intention corresponding to the information to be replied, significantly improving the accuracy of the reply candidate.
Smart Images

Figure CN110765338B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data processing method, device and a device for data processing. Background Art
[0002] With the development of communication technology, communication applications such as SMS applications and instant messaging applications have been accepted by more and more users. For example, users can use instant messaging applications to transmit text and multimedia (including video and audio, etc.) information with their family, friends or colleagues to achieve the function of communication.
[0003] At present, in order to improve the efficiency of message reply, existing solutions can provide an intelligent reply function, which can generate reply candidates for the message to be replied from the sender, so that the user can directly select the required reply candidate to reply; since it can save the user the operation of manually entering the reply content, it can improve the user's reply efficiency.
[0004] The existing reply candidates are usually generated based on the analysis of the information to be replied. For example, if the information to be replied is "How is the weather today?", the natural language processing technology can be used to analyze the content of the information to be replied, and reply candidates such as "sunny", "cloudy", and "overcast" can be generated based on the analysis results.
[0005] However, in some scenarios, the reply candidates generated by existing solutions based on the analysis of the information to be replied may have low accuracy.
[0006] For example, in a conversation scenario, the content of the communication conversation between user A and user B is as follows:
[0007] User A: What’s the weather like today?
[0008] User B: Sunny day.
[0009] User A: What about tomorrow?
[0010] For the terminal used by user B, the existing solution running on it can take "What about tomorrow?" sent by user A as the message to be replied, and then obtain reply candidates such as "Tomorrow is OK" and "Tomorrow should be fine"; however, these reply candidates are not related to the reply intent corresponding to the message to be replied, and therefore have low accuracy. Summary of the invention
[0011] The embodiments of the present invention provide a data processing method, an apparatus and an apparatus for data processing, which can improve the correlation between reply candidates and the reply intention corresponding to the information to be replied, thereby improving the accuracy of the reply candidates.
[0012] In order to solve the above problem, an embodiment of the present invention discloses a data processing method, including:
[0013] Determine the information to be replied and the context corresponding to the information to be replied;
[0014] Determine a reply candidate corresponding to the information to be replied according to the information to be replied and the above context;
[0015] The response candidates are output.
[0016] On the other hand, an embodiment of the present invention discloses a data processing device, including:
[0017] An information context determination module, used to determine the information to be replied and the context corresponding to the information to be replied;
[0018] A reply candidate determination module, used to determine a reply candidate corresponding to the information to be replied to based on the information to be replied to and the above context; and
[0019] The reply candidate output module is used to output the reply candidate.
[0020] In another aspect, an embodiment of the present invention discloses a device for data processing, 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. The one or more programs include instructions for performing the following operations:
[0021] Determine the information to be replied and the context corresponding to the information to be replied;
[0022] Determine a reply candidate corresponding to the information to be replied according to the information to be replied and the above context;
[0023] The response candidates are output.
[0024] On the other hand, an embodiment of the present invention discloses a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to perform one or more of the data processing methods described above.
[0025] The embodiments of the present invention include the following advantages:
[0026] The embodiment of the present invention uses the context corresponding to the information to be replied to in the process of determining the reply candidates corresponding to the information to be replied to, and the context may include relevant information corresponding to the information to be replied to. In particular, the context may reflect the reply intention corresponding to the information to be replied to to a certain extent; therefore, the correlation between the reply candidates and the reply intention corresponding to the information to be replied to can be improved, thereby improving the accuracy of the reply candidates. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0028] Figure 1 It is a schematic diagram of an application environment of a data processing method according to an embodiment of the present invention;
[0029] Figure 2 is a flow chart of steps of a data processing method embodiment 1 of the present invention;
[0030] Figure 3 It is an example of a communication dialogue content in an embodiment of the present invention;
[0031] Figure 4 is a flow chart of steps of a second embodiment of a data processing method of the present invention;
[0032] Figure 5 is a structural block diagram of an embodiment of a data processing device of the present invention;
[0033] Figure 6 is a block diagram of an apparatus 800 for data processing according to the present invention; and
[0034] Figure 7 It is a schematic diagram of the structure of the server in some embodiments of the present invention. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] An embodiment of the present invention provides a data processing scheme, which can determine information to be replied and the context corresponding to the information to be replied; determine a reply candidate corresponding to the information to be replied based on the information to be replied and the context; and output the reply candidate.
[0037] The embodiment of the present invention can automatically determine the reply candidates corresponding to the information to be replied, so that the user can directly select the desired reply candidate to reply; since the user can save the operation of manually inputting the reply content, the user's reply efficiency can be improved.
[0038] The embodiment of the present invention uses the context corresponding to the information to be replied to in the process of determining the reply candidates corresponding to the information to be replied to, and the context may include relevant information corresponding to the information to be replied to. In particular, the context may reflect the reply intention corresponding to the information to be replied to to a certain extent; therefore, the correlation between the reply candidates and the reply intention corresponding to the information to be replied to can be improved, thereby improving the accuracy of the reply candidates.
[0039] In an application example 1 of the present invention, the content of the communication dialogue between user A and user B is as follows:
[0040] User A: What’s the weather like today?
[0041] User B: Sunny day.
[0042] User A: What about tomorrow?
[0043] For the terminal used by user B, it can execute the solution of the embodiment of the present invention, specifically, "What about tomorrow?" sent by user A can be used as the information to be replied. Since the context corresponding to the information to be replied can reflect the reply intent corresponding to the information to be replied: "weather", the embodiment of the present invention can obtain reply candidates such as "sunny", "don't know", and "cloudy". These reply candidates have a certain correlation with the reply intent corresponding to the information to be replied, so the accuracy of the reply candidates can be improved.
[0044] The data processing method provided by the embodiment of the present invention can be applied to application environments such as websites and / or APPs (applications), and can improve the relevance between the reply candidates and the reply intentions corresponding to the information to be replied, thereby improving the accuracy of the reply candidates. The application environment of the website may include: a web version instant messaging environment, etc., and the application environment of the APP may include: an instant messaging environment of the application category, such as a WeChat environment, a short message environment, an email environment, etc.
[0045] The data processing method provided by the embodiment of the present invention can be applied to Figure 1 In the application environment shown,
[0046] Figure 1 As shown, the client 100 and the server 200 are located in a wired or wireless network, and the client 100 and the server 200 perform data exchange through the wired or wireless network.
[0047] Optionally, the client 100 can run on a communication terminal, which specifically includes but is not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, car computers, desktop computers, set-top boxes, smart TVs, wearable devices, etc.
[0048] The communication peer is another participant in the communication session in which the communication terminal participates, and may be only one other participant or one of multiple participants. The communication number may be an identifier that can uniquely identify each participating communication terminal in the communication session, such as a fixed telephone number, MDN (Mobile Directory Number), MSISDN (Mobile Station International Subscriber Directory Number), or MIN (Mobile Identification Number), or an instant messaging user account or a social network user account.
[0049] In one embodiment of the present invention, the client 100 running on the communication terminal can establish a communication dialogue with the communication peer, and the content of the communication dialogue can specifically include: information received from the communication peer, and / or information sent to the communication peer. The client 100 can determine the information to be replied and its context from the content of the communication dialogue, determine the reply candidate corresponding to the information to be replied based on the information to be replied and the context, and display the reply candidate to the user for the user to select.
[0050] Of course, the above-mentioned client 100 executing the method of the embodiment of the present invention is only taken as an example. In fact, the server 200 can also determine the reply candidate corresponding to the to-be-replied information by executing the method of the embodiment of the present invention.
[0051] Method Example 1
[0052] Reference Figure 2 , shows a flow chart of the steps of a data processing method embodiment 1 of the present invention, the method may specifically include the following steps:
[0053] Step 201: Determine the information to be replied and the context corresponding to the information to be replied;
[0054] Step 202: Determine a reply candidate corresponding to the information to be replied based on the information to be replied and the above context;
[0055] Step 203: Output the reply candidates.
[0056] Figure 2 At least one step of the illustrated embodiment may be executed by a server and / or a client. Of course, the embodiment of the present invention does not limit the specific execution subject of each step.
[0057] In an optional embodiment of the present invention, Figure 2 At least one step of the illustrated embodiment may be executed by an input method APP.
[0058] The input method (IME) mentioned here refers to an editing tool that allows the user of the device to input text and symbols into the device using input tools such as a keyboard, handwriting tablet, touch screen, or sound acquisition device. The input method uses certain encoding rules to convert the user's input information (pinyin string, Wubi string, handwriting tablet input track, etc.) into a character code that can be processed by the machine. The input method is the entry program for the user to process computer information. The characters supported by the input method may include: text, letters, numbers, symbols, etc., and the text may further include: English, Chinese, Japanese, Korean, etc.
[0059] As a host program, the input method APP can be applied to various application scenarios. For example, users can input characters in an instant messaging APP (application) to communicate with other users, or can input characters in a document APP to edit documents, or can enter characters in a search APP to search, and so on.
[0060] In step 201, the message to be replied and its context can be determined from the communication conversation content.
[0061] Optionally, the process of determining the information to be replied and the above text corresponding to the information to be replied in step 201 may specifically include:
[0062] The most recent or most recent messages received from the communication peer are used as messages to be replied;
[0063] The information other than the information to be replied is obtained from the communication dialogue content corresponding to the communication peer end as the context corresponding to the information to be replied.
[0064] Reference Figure 3, shows an example of the content of a communication conversation in an embodiment of the present invention, which can display information in chronological order from far to near through a communication conversation window 300; the displayed communication conversation content may specifically include: information 1 sent by the communication peer, information 2 sent by the communication terminal... information n sent by the communication peer, wherein n is a natural number greater than 1, and information n is the most recent information received from the communication peer.
[0065] According to an embodiment, the embodiment of the present invention may use information n as the information to be replied 301, and may use the first (n-1) pieces of information as the previous context 302 corresponding to the information to be replied.
[0066] According to another embodiment, when the value of n is large, N messages can be selected from n messages in order of time from recent to far; further, message n can be used as the message to be replied, and the first (N-1) messages among the N messages can be used as the context corresponding to the message to be replied; N is a natural number less than n.
[0067] According to another embodiment, when the value of n is large, M pieces of information generated within a preset time period can be selected from n pieces of information according to the time when the information is generated; further, the information n can be used as the information to be replied, and the first (M-1) pieces of information among the M pieces of information can be used as the context corresponding to the information to be replied. The end time of the preset time period can be the current time, and the length of the preset time period can be a time threshold, for example, the time threshold can be 1 hour, 2 hours, etc.
[0068] In an optional embodiment of the present application, taking into account the situation that some users are accustomed to sending short messages, that is, accustomed to dividing a sentence or an expression into multiple messages for sending, the messages received from the communication partner many times recently can be used as messages to be replied to, thus satisfying the user's habit of dividing a sentence or an expression into multiple messages for sending.
[0069] In an optional embodiment of the present application, the context corresponding to the to-be-replied information may also be screened, and the corresponding screening process may include: determining the relevance between the to-be-replied information and the context; and screening the context corresponding to the to-be-replied information based on the relevance. For example, contexts with a relevance less than a relevance threshold may be filtered out, and contexts with a relevance exceeding the relevance threshold may be retained. The screened context may be used as input to step 202.
[0070] In the embodiment of the present invention, the type of the information to be replied may include but is not limited to: short message, QQ message, WeChat message, WhatsApp message, Google Talk message, or MSN Messenger (Microsoft Service Network Messenger) message, etc.
[0071] In an application example 2 of the present invention, the communication conversation content between user C and user D is arranged in order from the earliest to the latest time as follows:
[0072] User C: Are you free in the evening?
[0073] User D: No time.
[0074] User C: What about tomorrow?
[0075] Then, in the embodiment of the present invention, "What about tomorrow?" can be used as the information to be replied, and "Are you free in the evening?" and "No time" can be used as the context of the information to be replied.
[0076] In the process of determining the reply candidates corresponding to the information to be replied in step 202, the information to be replied and its corresponding context can be used, and the context can include relevant information corresponding to the information to be replied. In particular, the context can reflect the reply intention corresponding to the information to be replied to a certain extent; therefore, the correlation between the reply candidates and the reply intention corresponding to the information to be replied can be improved, thereby improving the accuracy of the reply candidates.
[0077] For application example 2, the context corresponding to the information to be replied to can reflect the reply intent corresponding to the information to be replied to: "Are you free?", so the embodiment of the present invention can obtain reply candidates such as "Yes," "Yes," "Not free tomorrow," "Let's see tomorrow," and "Not sure." These reply candidates have a certain correlation with the reply intent corresponding to the information to be replied to, so the accuracy of the reply candidates can be improved.
[0078] It should be noted that the information to be replied to corresponding to Application Example 1 and Application Example 2 is the same, both of which are "What about tomorrow?". Since only the information to be replied to is considered in the process of determining the reply candidates, the existing solution will give the same reply candidates for Application Example 1 and Application Example 2. However, since the information to be replied to and its corresponding context can be used in the process of determining the reply candidates corresponding to the information to be replied to in the embodiment of the present invention, and since the contexts corresponding to Application Example 1 and Application Example 2 are different, the embodiment of the present invention can give different reply candidates for Application Example 1 and Application Example 2, thereby improving the accuracy of the reply candidates.
[0079] The embodiment of the present invention may provide the following technical solution for determining the reply candidate corresponding to the to-be-replied information:
[0080] Determine the plan 1.
[0081] In the determination scheme 1, the process of determining the reply candidate corresponding to the information to be replied to in step 202 according to the information to be replied to and the above context may specifically include:
[0082] Determine respectively the first representation and the second representation corresponding to the information to be replied and the above text;
[0083] The first representation and the second representation are input into a first reply model to obtain reply candidates output by the first reply model; wherein, the first reply model can be obtained by learning first training data, and the first training data can specifically include: multiple training samples, and a training sample can specifically include: a sample of information to be replied, a sample of the above text, and a reply sample.
[0084] The first representation and the second representation are used to represent the information to be replied and the previous text, respectively. Optionally, the first representation and the second representation may be in the form of: vector or text.
[0085] The first response model can be a supervised machine learning model, and the machine learning methods may include: Bayesian method, neural network method, etc. Machine learning methods can design and analyze some algorithms that allow computers to learn automatically. These algorithms can automatically analyze and obtain rules from training data, and use the rules to predict unknown data. Therefore, they have good robustness and can obtain higher accuracy.
[0086] Specifically to the embodiment of the present invention, the embodiment of the present invention can define parameters: c, m and r, where m represents the information to be replied, c represents the previous text, and r represents the reply candidate. The embodiment of the present invention can learn P(r︱c, m) from the training data through a machine learning method, where P(r︱c, m) represents the probability of r appearing under the premise that c and m appear.
[0087] In an optional embodiment of the present invention, a neural network method may be used to learn the training data to obtain the parameters of the first response model.
[0088] Optionally, the parameters of the first response model can be parameters of a fully connected matrix. The fully connected matrix is relative to the fully connected layer of the neural network. Each node of the fully connected layer is connected to all nodes of the previous layer to integrate the features extracted previously.
[0089] The neural network method is used to learn the training data. The learning goal is to iteratively learn the parameters of the fully connected matrix so that the conditional probability P(ri ︱c i , m i ) is closer to 1, where c i 、m i 、r i They represent the previous sample, the information sample to be replied and the reply sample included in a training sample respectively.
[0090] The iterative method used in iterative learning may include, but is not limited to: gradient descent method, least square method, Newton method, etc. It can be understood that the embodiment of the present invention does not limit the specific iterative method.
[0091] The training data of the embodiment of the present invention may come from a conversation database, and the conversation data in the conversation database may come from client data collected by a communication application. It can be understood that the embodiment of the present invention does not limit the specific source of the training data.
[0092] In the embodiment of the present invention, the first representation or the second representation in vector form can be obtained through the following technical solution:
[0093] Technical Solution 1
[0094] Technical solution 1 can obtain the first representation or the second representation in vector form through a classification model.
[0095] In an optional embodiment of the present invention, the second representation may be the target category to which the text belongs. A person skilled in the art or a user may determine multiple categories according to actual application requirements. In this way, the classification model may be used to determine which of the multiple categories the text belongs to, that is, to determine the target category corresponding to the first representation. Examples of preset categories may include: "Weather", "Is Idle", "Movies", "TV", "Music", "Football", etc. In this way, the classification model may be used to determine that the text in Application Example 1 belongs to the "Weather" category, and the classification model may be used to determine that the text in Application Example 2 belongs to the "Is Idle" category, etc.
[0096] Since the category corresponding to the above context can reflect the reply intention corresponding to the information to be replied to to a certain extent; therefore, the correlation between the reply candidates and the reply intention corresponding to the information to be replied to can be improved, thereby improving the accuracy of the reply candidates.
[0097] Optionally, the above classification model can be a fastText model. The fastText model can output the probability that a word sequence (a paragraph of text or a sentence) belongs to different categories for an input word sequence. The fastText model can form a feature vector of words and phrases in the word sequence, and the feature vector is mapped to an intermediate layer through a linear transformation, and the intermediate layer is mapped to a corresponding preset category. Optionally, fastText can use a nonlinear activation function in the process of mapping to the corresponding preset category. fastText has the advantages of fast speed and high accuracy. Of course, the embodiments of the present invention are not limited to the specific classification model.
[0098] In an optional embodiment of the present invention, the first representation may be the target category to which the information to be replied belongs. As for the process of determining the target category to which the information to be replied belongs, since it is similar to the process of determining the target category to which the information to be replied belongs, it will not be described in detail here, and reference can be made to each other. Of course, the first representation of the embodiment of the present invention may also be the information to be replied itself.
[0099] The classification result output by the fastText model may be in vector form. Therefore, the embodiment of the present invention may obtain the first representation or the second representation in vector form.
[0100] Technical solution 2,
[0101] Technical solution 1 can obtain the first representation or the second representation in vector form through a word vector generation model; the word vector generation model can convert words in natural language into dense vectors that can be understood by a computer. Optionally, the word vectors of a word sequence can be concatenated to obtain the word vector corresponding to the word sequence.
[0102] Word vectors have good semantic properties and are a common way to represent word features. The value of each dimension of a word vector represents a feature with certain semantic and grammatical interpretations. Therefore, each dimension of a word vector can be called a word feature.
[0103] Examples of word vector generation models may include: Word2vec. Word2vec can project words into a K-dimensional vector space, and each word can be represented by a K-dimensional vector. It can be understood that the embodiments of the present invention do not limit the word vector generation model.
[0104] Determine plan 2.
[0105] In the determination scheme 2, the process of determining the reply candidate corresponding to the information to be replied to in step 202 according to the information to be replied to and the above context may specifically include:
[0106] Determine the subject to which the above text corresponds;
[0107] Determine a reply candidate corresponding to the information to be replied based on the subject and the information to be replied.
[0108] The theme may refer to the central idea expressed in the above text. In the embodiment of the present invention, the theme may be represented by a theme keyword, and the theme keyword may refer to a keyword that can reflect the theme of the text content.
[0109] The embodiment of the present invention may provide the following method for determining the subject corresponding to the above text:
[0110] Determination method 1: Use TF-IDF (term frequency-inverse document frequency algorithm, term frequency-inverse document frequency) method to determine the topic keywords corresponding to the above text.
[0111] The main idea of TF-IDF is that if a word or phrase appears in a document or a text with a high frequency TF and rarely appears in other documents or texts, it is considered that this word or phrase has good category discrimination ability and is suitable for classification.
[0112] Determination method 2: Use the LDA (Latent Dirichlet Allocation) model to determine the topic keywords corresponding to the above text.
[0113] The LDA model is a document generation model and an unsupervised machine learning technology. It believes that a document has multiple topics, and each topic corresponds to different topic keywords. The construction process of a document first selects a topic with a certain probability, and then selects a topic keyword under this topic with a certain probability, thus generating the first topic keyword of this document. Repeating this process continuously generates the entire article. The use of LDA is the inverse process of the above document generation process, that is, based on a document obtained, to find the topic of this document and the topic keywords corresponding to these topics.
[0114] Determination method 3: Use a classification model to determine the category corresponding to the above text, and obtain the subject keyword based on the information of the category. The classification model may include: the aforementioned fasttext model.
[0115] It can be understood that those skilled in the art can adopt any one or a combination of the above-mentioned determination methods 1 to 3 according to actual application requirements, and the embodiment of the present invention does not limit the specific process of determining the subject matter corresponding to the above.
[0116] In an optional embodiment of the present application, the above text may correspond to multiple topics. In this case, a target topic can be determined from the multiple topics.
[0117] In the embodiment of the present invention, the target subject may satisfy at least one of the following conditions:
[0118] Condition 1: The above does not contain the reply content corresponding to the target topic; and
[0119] Condition 2: The target topic is related to the information to be replied.
[0120] Condition 1 can indicate that the target topic has not been replied to, so as to exclude questions that have been replied to; Condition 2 can exclude topics that are not related to the information to be replied to.
[0121] Optionally, the process of determining a target topic from a plurality of topics may include: determining whether the above text contains a reply content corresponding to a topic, and if so, filtering out the topic.
[0122] In an example of the present invention, assuming that the above text includes: "Will it rain tomorrow?", "Do you have an umbrella at home?", "Let's take the subway?", "It will rain tomorrow, I have an umbrella", and assuming that the information to be replied includes: "Can I take the subway"; in this example, the topics corresponding to the above text may include: "Will it rain tomorrow?", "Do you have an umbrella?", and "Will you take the subway?" Among them, the above text already includes the reply content of "Will it rain tomorrow?" and "Do you have an umbrella?", so the topic of "Will you take the subway" can be retained, that is, the target topic can be determined as "Will you take the subway", thereby improving the accuracy of the topic corresponding to the above text.
[0123] According to an embodiment, determining the reply candidates corresponding to the information to be replied based on the subject and the information to be replied may specifically include: filtering the reply content corresponding to the information to be replied based on the subject to obtain the reply candidates corresponding to the information to be replied.
[0124] The embodiment of the present invention can use text analysis technology to determine the reply content corresponding to the information to be replied, and the above reply content can be multiple. Further, the multiple reply contents can be screened according to the subject, and the reply content matching the subject is used as the reply candidate corresponding to the information to be replied. The above screening can filter out the reply content that is not related to the subject, and can retain the reply content related to the subject.
[0125] Taking application example 1 as an example, the multiple replies corresponding to the information to be replied to include: "Tomorrow is OK", "Tomorrow should be fine", "Sunny", "I don't know", "Cloudy", etc., then according to the subject "Weather", you can filter out "Tomorrow is OK", "Tomorrow should be fine", and keep "Sunny", "I don't know", "Cloudy", etc.
[0126] Taking application example 2 as an example, the multiple replies corresponding to the information to be replied to include: "Tomorrow is ok", "Should be fine tomorrow", "It will be better", "Is it open", "Weather", etc., then according to the subject "Are you free", you can filter out "It will be better", "Is it open", "Weather", and keep "Tomorrow is ok", "Should be fine tomorrow", etc.
[0127] According to another embodiment, the above-mentioned determining the reply candidates corresponding to the information to be replied based on the subject and the information to be replied may specifically include: inputting the information to be replied into a second reply model corresponding to the subject to obtain the reply candidates output by the second reply model; wherein, the second reply model is obtained by learning second training data, and the second training data may include: samples of the information to be replied and reply samples corresponding to the subject.
[0128] The second reply model may be a reply model corresponding to a topic, and the second training data may include: a training sample corresponding to a topic, so the reply candidates output by the second reply model may be related to the topic, thereby improving the accuracy of the reply candidates.
[0129] According to another embodiment, the above-mentioned determining the reply candidates corresponding to the information to be replied based on the subject and the information to be replied may specifically include: searching in the data source corresponding to the subject based on the information to be replied and the environmental characteristics of the user to obtain the reply candidates corresponding to the information to be replied.
[0130] The data source corresponding to the theme can be used to provide data corresponding to the theme. The data source corresponding to the theme may include: the database of the APP, the database of the website, etc. Taking the theme of "weather" as an example, the data source corresponding to the theme may include: the database of the weather APP, the database of the weather website, etc. Taking the theme of "Is Idle" as an example, the data source corresponding to the theme may include: reminder data recorded by the memo APP or reminder APP, etc. These reminder data may include the user's itinerary, so they can be used to judge "is idle". It can be understood that the embodiments of the present invention do not limit the specific data sources corresponding to specific themes.
[0131] The environmental characteristics of the user may refer to the environmental characteristics of the user within a preset time period. The above environmental characteristics may include but are not limited to: location environmental characteristics, network environmental characteristics, time environmental characteristics, etc.
[0132] The embodiments of the present invention can improve the accuracy of the reply candidates by searching for reply candidates based on the environmental characteristics of the user. For example, weather data at a specific time can be queried based on location environmental characteristics and time environmental characteristics to improve the accuracy of the reply candidates. For another example, reminder data at a specific time can be queried based on time environmental characteristics to improve the accuracy of the reply candidates. It can be understood that the embodiments of the present invention are not limited to specific environmental characteristics.
[0133] In step 203, if the execution subject is a server, the server may send a reply candidate to the client; or, if the execution subject is a client, the client may display the reply candidate to the user for selection. Optionally, the reply candidate may be one or more, and the embodiment of the present invention may display the reply candidate selected by the user in the input box of the communication APP, or the embodiment of the present invention may send the reply candidate selected by the user to the communication peer to display the reply candidate selected by the user in the communication dialog box.
[0134] In summary, the data processing method of the embodiment of the present invention uses the context corresponding to the information to be replied to in the process of determining the reply candidates corresponding to the information to be replied to, and the context may include relevant information corresponding to the information to be replied to. In particular, the context may reflect the reply intention corresponding to the information to be replied to to a certain extent; therefore, the correlation between the reply candidates and the reply intention corresponding to the information to be replied can be improved, thereby improving the accuracy of the reply candidates.
[0135] Method Example 2
[0136] Reference Figure 4 , shows a flow chart of the steps of a data processing method embodiment 2 of the present invention, the method may specifically include the following steps:
[0137] Step 401: Determine the information to be replied and the context corresponding to the information to be replied;
[0138] Step 402: Determine a first category vector corresponding to the information to be replied, and a second category vector corresponding to the above text;
[0139] Step 403: input the first category vector and the second category vector into a first reply model to obtain a reply candidate output by the first reply model; wherein the first reply model may be obtained by learning first training data, and the first training data may include: a sample of information to be replied, a sample of the previous text, and a sample of the reply;
[0140] Step 404: Display the reply candidates.
[0141] Both the first category vector and the second category vector may be category information in vector form. Optionally, the first category vector and the second category vector may be determined by a classification model such as a fasttext model.
[0142] Since the second category vector is used to represent the category information above, it can reflect the reply intention corresponding to the information to be replied to to a certain extent; therefore, the correlation between the reply candidate and the reply intention corresponding to the information to be replied to can be improved, thereby improving the accuracy of the reply candidate.
[0143] Moreover, since the first category vector is used to represent the category information of the information to be replied, it can reflect the reply intention corresponding to the information to be replied to a certain extent; therefore, the correlation between the reply candidate and the reply intention corresponding to the information to be replied can be improved, thereby improving the accuracy of the reply candidate.
[0144] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, 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 application.
[0145] Device Embodiment
[0146] Reference Figure 5 , shows a structural block diagram of an embodiment of a data processing device of the present invention, which may specifically include: an information context determination module 501, a reply candidate determination module 502 and a reply candidate output module 503.
[0147] The information context determination module 501 is used to determine the information to be replied and the context corresponding to the information to be replied;
[0148] A reply candidate determination module 502, configured to determine a reply candidate corresponding to the information to be replied to based on the information to be replied to and the above context; and
[0149] The reply candidate output module 503 is used to output the reply candidates.
[0150] Optionally, the information context determining module 501 may include:
[0151] The submodule for determining information to be replied is used to take the information received most recently or most recently from the communication peer as the information to be replied;
[0152] The context determining submodule is used to obtain information other than the information to be replied from the communication dialogue content corresponding to the communication peer as the context corresponding to the information to be replied.
[0153] Optionally, the reply candidate determination module 502 may include:
[0154] A representation determination submodule, used to respectively determine the first representation and the second representation corresponding to the to-be-replied information and the above text;
[0155] The first model classification submodule is used to input the first representation and the second representation into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning the first training data, and the first training data may include: samples of information to be replied, previous samples and reply samples.
[0156] Optionally, the reply candidate determination module 502 may include:
[0157] A topic determination submodule, used to determine the topic corresponding to the above text;
[0158] The candidate determination submodule is used to determine the reply candidate corresponding to the information to be replied based on the subject and the information to be replied.
[0159] Optionally, the candidate determination submodule may include:
[0160] The screening unit is used to screen the reply content corresponding to the information to be replied to according to the subject, so as to obtain the reply candidates corresponding to the information to be replied to.
[0161] Optionally, the candidate determination submodule may include:
[0162] The second model classification unit is used to input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein, the second reply model is obtained by learning the second training data, and the second training data may include: samples of the information to be replied and reply samples corresponding to the topic.
[0163] Optionally, the candidate determination submodule may include:
[0164] The search unit is used to search in the data source corresponding to the topic according to the information to be replied and the environmental characteristics of the user, so as to obtain the reply candidate corresponding to the information to be replied.
[0165] 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.
[0166] 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.
[0167] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0168] An embodiment of the present invention provides a device for data processing, including 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: determining information to be replied to, and the context corresponding to the information to be replied to; determining a reply candidate corresponding to the information to be replied to based on the information to be replied to and the context; and outputting the reply candidate.
[0169] Figure 6 8 is a block diagram of a device 800 for data processing according to an exemplary embodiment. For example, the device 800 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.
[0170] Reference Figure 6 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0171] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0172] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 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.
[0173] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0174] The multimedia component 808 includes a screen that provides an output interface between the device 800 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 808 includes a front camera and / or a rear camera. When the device 800 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 rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0175] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice data processing mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0176] I / O interface 812 provides an interface between processing component 802 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.
[0177] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 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 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0178] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 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 816 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 816 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 data processing (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0179] In an exemplary embodiment, the apparatus 800 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 method.
[0180] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 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.
[0181] Figure 71 is a schematic diagram of the structure of the server in some embodiments of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0182] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0183] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to perform Figure 2 or Figure 3 or Figure 4 The data processing method shown.
[0184] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a device (server or terminal), enables the device to perform a data processing method, the method comprising: determining information to be replied, and the context corresponding to the information to be replied; determining a reply candidate corresponding to the information to be replied based on the information to be replied and the context; and outputting the reply candidate.
[0185] The embodiment of the present invention discloses A1, a data processing method, the method comprising:
[0186] Determine the information to be replied and the context corresponding to the information to be replied;
[0187] Determine a reply candidate corresponding to the information to be replied according to the information to be replied and the above context;
[0188] The response candidates are output.
[0189] A2. According to the method described in A1, the determining of the information to be replied and the context corresponding to the information to be replied includes:
[0190] The most recent or most recent messages received from the communication peer are used as messages to be replied;
[0191] The information other than the information to be replied is obtained from the communication dialogue content corresponding to the communication peer end as the context corresponding to the information to be replied.
[0192] A3. According to the method of A1 or A2, determining the reply candidate corresponding to the information to be replied based on the information to be replied and the above context includes:
[0193] Determine respectively the first representation and the second representation corresponding to the information to be replied and the above text;
[0194] The first representation and the second representation are input into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning first training data, and the first training data includes: a sample of information to be replied, a sample of the above text, and a reply sample.
[0195] A4. According to the method of A1 or A2, determining the reply candidate corresponding to the information to be replied based on the information to be replied and the above context includes:
[0196] Determine the subject to which the above text corresponds;
[0197] Determine a reply candidate corresponding to the information to be replied based on the subject and the information to be replied.
[0198] A5. The method according to A4, wherein determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0199] According to the subject, the reply content corresponding to the information to be replied is screened to obtain reply candidates corresponding to the information to be replied.
[0200] A6. The method according to A4, wherein determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0201] Input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
[0202] A7. The method according to A4, wherein determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0203] Based on the information to be replied and the environmental characteristics of the user, a search is performed in the data source corresponding to the topic to obtain a reply candidate corresponding to the information to be replied.
[0204] The embodiment of the present invention discloses B8, a data processing device, including:
[0205] An information context determination module, used to determine the information to be replied and the context corresponding to the information to be replied;
[0206] A reply candidate determination module, used to determine a reply candidate corresponding to the information to be replied to based on the information to be replied to and the above context; and
[0207] The reply candidate output module is used to output the reply candidate.
[0208] B9. According to the device described in B8, the information context determination module includes:
[0209] The submodule for determining information to be replied is used to take the information received most recently or most recently from the communication peer as the information to be replied;
[0210] The context determining submodule is used to obtain information other than the information to be replied from the communication dialogue content corresponding to the communication peer as the context corresponding to the information to be replied.
[0211] B10. According to the apparatus described in B8 or B9, the reply candidate determination module includes:
[0212] A representation determination submodule, used to respectively determine the first representation and the second representation corresponding to the to-be-replied information and the above text;
[0213] The first model classification submodule is used to input the first representation and the second representation into the first reply model to obtain the reply candidates output by the first reply model; wherein the first reply model is obtained by learning the first training data, and the first training data includes: samples of information to be replied, samples of the above text and reply samples.
[0214] B11. According to the apparatus described in B8 or B9, the reply candidate determination module includes:
[0215] A topic determination submodule, used to determine the topic corresponding to the above text;
[0216] The candidate determination submodule is used to determine the reply candidate corresponding to the information to be replied based on the subject and the information to be replied.
[0217] B12. According to the apparatus described in B11, the candidate determination submodule comprises:
[0218] The screening unit is used to screen the reply content corresponding to the information to be replied to according to the subject, so as to obtain the reply candidates corresponding to the information to be replied to.
[0219] B13. According to the apparatus described in B11, the candidate determination submodule comprises:
[0220] The second model classification unit is used to input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
[0221] B14. According to the apparatus described in B11, the candidate determination submodule comprises:
[0222] The search unit is used to search in the data source corresponding to the topic according to the information to be replied and the environmental characteristics of the user, so as to obtain the reply candidate corresponding to the information to be replied.
[0223] The embodiment of the present invention discloses C15, a device for data processing, 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:
[0224] Determine the information to be replied and the context corresponding to the information to be replied;
[0225] Determine a reply candidate corresponding to the information to be replied according to the information to be replied and the above context;
[0226] The response candidates are output.
[0227] C16. According to the apparatus of C15, the determining of the information to be replied and the context corresponding to the information to be replied comprises:
[0228] The most recent or most recent messages received from the communication peer are used as messages to be replied;
[0229] The information other than the information to be replied is obtained from the communication dialogue content corresponding to the communication peer end as the context corresponding to the information to be replied.
[0230] C17. According to the apparatus described in C15 or C16, determining the reply candidate corresponding to the information to be replied based on the information to be replied and the above context includes:
[0231] Determine respectively the first representation and the second representation corresponding to the information to be replied and the above text;
[0232] The first representation and the second representation are input into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning first training data, and the first training data includes: a sample of information to be replied, a sample of the above text, and a reply sample.
[0233] C18. According to the apparatus described in C15 or C16, determining the reply candidate corresponding to the information to be replied based on the information to be replied and the above context includes:
[0234] Determine the subject to which the above text corresponds;
[0235] Determine a reply candidate corresponding to the information to be replied based on the subject and the information to be replied.
[0236] C19. According to the device of C18, determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0237] According to the subject, the reply content corresponding to the information to be replied is screened to obtain reply candidates corresponding to the information to be replied.
[0238] C20. According to the apparatus of C18, determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0239] Input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
[0240] C21. According to the apparatus of C18, determining the reply candidate corresponding to the information to be replied based on the subject and the information to be replied comprises:
[0241] Based on the information to be replied and the environmental characteristics of the user, a search is performed in the data source corresponding to the topic to obtain a reply candidate corresponding to the information to be replied.
[0242] An embodiment of the present invention discloses D22, a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the data processing method as described in one or more of A1 to A7.
[0243] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0244] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0245] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
[0246] The above is a detailed introduction to a data processing method, a data processing device and a device for data processing provided in an embodiment of the present invention. Specific examples are used herein 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 a person 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 a limitation on the present invention.
Claims
1. A data processing method, It is characterized in that The method comprises: Multiple messages received recently from the communication peer are used as messages to be replied; When n is greater than a preset threshold, select N messages from the n messages in order of time from recent to far, and use the first (N-1) messages among the N messages as the context corresponding to the message to be replied; N is a natural number less than n; or select M messages generated within a preset time period from the n messages, and use the first (M-1) messages among the M messages as the context corresponding to the message to be replied; n is the total number of sent messages displayed in the communication dialog window; Determine the relevance between the information to be replied and the previous context; based on the relevance, filter the previous context corresponding to the information to be replied to, so as to filter out the previous context whose relevance is less than the relevance threshold, and retain the previous context whose relevance exceeds the relevance threshold; Determine the topic corresponding to the above text after screening; If the filtered text corresponds to multiple topics, a target topic is determined from the multiple topics corresponding to the filtered text, and the target topic satisfies at least one of the following conditions: the filtered text does not contain reply content corresponding to the target topic, and the target topic is related to the information to be replied; According to the information to be replied and the environmental characteristics of the user in a preset time period, a search is performed in the data source corresponding to the target topic to obtain a reply candidate corresponding to the information to be replied; the data source corresponding to the target topic is used to provide data corresponding to the target topic, and different topics have different data sources. The data source corresponding to the topic includes at least one of the following: a database of an application program, a database of a website; the environmental characteristics include at least one of the following: a location environment characteristic, a network environment characteristic, and a time environment characteristic; The response candidates are output.
2. The method according to claim 1, It is characterized in that The method further comprises: Determine respectively the first representation and the second representation corresponding to the to-be-replied information and the above text; The first representation and the second representation are input into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning first training data, and the first training data includes: a sample of information to be replied, a sample of the above text, and a reply sample.
3. The method according to claim 1, It is characterized in that The method further comprises: According to the subject, the reply content corresponding to the information to be replied is screened to obtain reply candidates corresponding to the information to be replied.
4. The method according to claim 1, It is characterized in that The method further comprises: Input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
5. A data processing device, It is characterized in that include: The information context determination module is used to take the multiple messages received from the communication peer in the recent multiple times as the messages to be replied; When n is greater than a preset threshold, select N messages from the n messages in order of time from recent to oldest, and use the first (N-1) messages among the N messages as the context corresponding to the message to be replied; N is a natural number less than n; or, M messages generated within a preset time period are selected from n messages, and the first (M-1) messages among the M messages are used as the previous context of the message to be replied; n is the total number of sent messages displayed in the communication dialog window; A reply candidate determination module, including a topic determination submodule and a candidate determination submodule; The topic determination submodule is used to determine the relevance between the information to be replied and the above text; According to the relevance, the context corresponding to the to-be-replied message is screened to filter out the context whose relevance is less than the relevance threshold, and retain the context whose relevance exceeds the relevance threshold; Determine the topic corresponding to the filtered text; if the filtered text corresponds to multiple topics, determine a target topic from the multiple topics corresponding to the filtered text, and the target topic satisfies at least one of the following conditions: the filtered text does not contain reply content corresponding to the target topic, and the target topic is related to the information to be replied; The candidate determination submodule is used to search in the data source corresponding to the target topic according to the information to be replied and the environmental characteristics of the user within a preset time period, so as to obtain the reply candidates corresponding to the information to be replied; The data source corresponding to the target theme is used to provide data corresponding to the target theme. Different themes have different data sources. The data source corresponding to the theme includes at least one of the following: an application database, a website database; the environmental characteristics include at least one of the following: location environment characteristics, network environment characteristics, and time environment characteristics; The reply candidate output module is used to output the reply candidate.
6. The device according to claim 5, It is characterized in that The reply candidate determination module comprises: A representation determination submodule, used to respectively determine the first representation and the second representation corresponding to the to-be-replied information and the above text; The first model classification submodule is used to input the first representation and the second representation into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning the first training data, and the first training data includes: a sample of information to be replied, a sample of the above text, and a reply sample.
7. The device according to claim 5, It is characterized in that The candidate determination submodule includes: The screening unit is used to screen the reply content corresponding to the information to be replied to according to the subject, so as to obtain the reply candidates corresponding to the information to be replied to.
8. The device according to claim 5, It is characterized in that The candidate determination submodule includes: The second model classification unit is used to input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
9. A device for data processing, It is characterized in that The system 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, wherein the one or more programs include instructions for performing the following operations: Multiple messages received recently from the communication peer are used as messages to be replied; When n is greater than a preset threshold, select N messages from the n messages in order of time from recent to oldest, and use the first (N-1) messages among the N messages as the context corresponding to the message to be replied; N is a natural number less than n; or, M messages generated within a preset time period are selected from n messages, and the first (M-1) messages among the M messages are used as the previous context of the message to be replied; n is the total number of sent messages displayed in the communication dialog window; Determine the relevance between the information to be replied and the above text; According to the relevance, the context corresponding to the to-be-replied message is screened to filter out the context whose relevance is less than the relevance threshold, and retain the context whose relevance exceeds the relevance threshold; Determine the topic corresponding to the above text after screening; If the filtered text corresponds to multiple topics, a target topic is determined from the multiple topics corresponding to the filtered text, and the target topic satisfies at least one of the following conditions: the filtered text does not contain reply content corresponding to the target topic, and the target topic is related to the information to be replied; Based on the information to be replied and the environmental characteristics of the user within a preset time period, searching in the data source corresponding to the target topic to obtain a reply candidate corresponding to the information to be replied; The data source corresponding to the target theme is used to provide data corresponding to the target theme. Different themes have different data sources. The data source corresponding to the theme includes at least one of the following: an application database, a website database; the environmental characteristics include at least one of the following: location environment characteristics, network environment characteristics, and time environment characteristics; The response candidates are output.
10. The device according to claim 9, It is characterized in that The one or more programs also include instructions for performing the following operations: Determine respectively the first representation and the second representation corresponding to the to-be-replied information and the above text; The first representation and the second representation are input into a first reply model to obtain reply candidates output by the first reply model; wherein the first reply model is obtained by learning first training data, and the first training data includes: a sample of information to be replied, a sample of the above text, and a reply sample.
11. The device according to claim 9, It is characterized in that The one or more programs also include instructions for performing the following operations: According to the subject, the reply content corresponding to the information to be replied is screened to obtain reply candidates corresponding to the information to be replied.
12. The device according to claim 9, It is characterized in that The one or more programs also include instructions for performing the following operations: Input the information to be replied to into the second reply model corresponding to the topic to obtain the reply candidates output by the second reply model; wherein the second reply model is obtained by learning the second training data, and the second training data includes: samples of the information to be replied and reply samples corresponding to the topic.
13. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform a data processing method as claimed in one or more of claims 1 to 4.
