CN112631435A - Input method, device, equipment and storage medium - Google Patents

Input method, device, equipment and storage medium Download PDF

Info

Publication number
CN112631435A
CN112631435A CN201910907038.XA CN201910907038A CN112631435A CN 112631435 A CN112631435 A CN 112631435A CN 201910907038 A CN201910907038 A CN 201910907038A CN 112631435 A CN112631435 A CN 112631435A
Authority
CN
China
Prior art keywords
reply
corpuses
linguistic data
corpus
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910907038.XA
Other languages
Chinese (zh)
Inventor
黄海兵
邱晓杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN201910907038.XA priority Critical patent/CN112631435A/en
Publication of CN112631435A publication Critical patent/CN112631435A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0237Character input methods using prediction or retrieval techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the application discloses an input method, an input device, input equipment and a storage medium, wherein the method comprises the following steps: acquiring the information of the target conversation; determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein the dialogue model is obtained by training according to the historical upper-text information and the historical reply corpora corresponding to the historical upper-text information; determining a translation result corresponding to at least one reply corpus in the N reply corpuses; and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items. Therefore, diversified reply corpora are automatically provided for the user, and the use experience of the user is improved.

Description

Input method, device, equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to an input method, apparatus, device, and storage medium.
Background
With the popularization of terminal devices and various chat tools, users can chat with other users by means of the chat tools running on the terminal devices. For example, when a first user and a second user are chatting, the terminal device of the first user receives and displays the chat content sent by the second user, so that the first user can reply to the chat content sent by the second user by means of the terminal device.
In the prior art, the user edits the content to reply by himself. However, in practical applications, for some similar or identical problems, a user usually replies with the same content, so that when receiving a plurality of similar or identical problems, the user needs to edit the same content repeatedly for many times through the input method client to reply, and cannot realize quick reply, and time of the user is wasted.
Disclosure of Invention
The embodiment of the application provides an input method, an input device, equipment and a storage medium, which can automatically provide diversified reply corpora for a user and improve the use experience of the user.
In view of the above, a first aspect of the present application provides an input method, including:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained by training according to historical previous information and historical reply corpora corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
according to the grade of each reply corpus in the N reply corpuses, performing descending order arrangement on the N reply corpuses, and selecting M reply corpuses with the front order from the N reply corpuses, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
selecting M reply linguistic data commonly used by the current login user from the N reply linguistic data, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining a translation result corresponding to any reply corpus in the N reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining the translation result of the common foreign language type corresponding to any M reply linguistic data in the N reply linguistic data according to the common foreign language type of the current login user.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
determining the target foreign language type of the current login user according to the current interaction information of the current login user;
and determining a translation result of the target foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the target foreign language type of the current login user.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
performing descending sorting on the N reply linguistic data according to the scores corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sorting result;
and sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at the adjacent position of the corresponding first-class candidate item.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and at least one reply linguistic data in the N reply linguistic data, performing descending order sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and sequentially displaying the N replying linguistic data and the translation result corresponding to at least one replying linguistic data in the N replying linguistic data as candidate items according to the second sorting result.
A second aspect of the present application provides an input device, the device comprising:
the acquisition module is used for acquiring the information of the target conversation;
the reply corpus determining module is used for determining N reply corpuses corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained according to historical previous information and historical reply training corresponding to the historical previous information;
a translation result determining module, configured to determine a translation result corresponding to each of at least one of the N reply corpuses;
and the candidate item display module is used for displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
Optionally, the translation result determining module includes:
a first selection submodule, configured to perform descending order arrangement on the N reply corpuses according to a score of each reply corpus in the N reply corpuses, and select M reply corpuses with a top order from the N reply corpuses, where M is smaller than N;
and the first determining submodule is used for determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the translation result determining module includes:
a second selection submodule, configured to select M reply corpora frequently used by the current login user from the N reply corpora, where M is smaller than N;
and the second determining submodule is used for determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the translation result determining module is specifically configured to determine a translation result corresponding to any M reply corpuses in the N reply corpuses.
Optionally, the translation result determining module is specifically configured to determine, according to a common foreign language type of a currently logged-in user, a translation result of the common foreign language type corresponding to each of at least one of the N reply corpuses.
Optionally, the translation result determining module is specifically configured to determine a target foreign language type of the current login user according to current interaction information of the current login user, and determine a translation result of the target foreign language type corresponding to each of at least one of the N reply corpuses according to the target foreign language type of the current login user.
Optionally, the candidate item display module includes:
the first sequencing submodule is used for performing descending sequencing on the N reply linguistic data according to the score corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sequencing result;
and the candidate item display sub-module is used for sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at an adjacent position of the corresponding first-class candidate item.
Optionally, the candidate item display module includes:
the second sorting submodule is used for performing descending sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and the candidate item display sub-module is used for sequentially displaying the N reply linguistic data and a translation result corresponding to at least one reply linguistic data in the N reply linguistic data as candidate items according to the second sorting result.
In a third aspect, an input device is provided in an embodiment of the present application, which includes a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by the one or more processors includes instructions for:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained according to historical previous information and historical reply training corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
In a fourth aspect, embodiments of the present application provide a computer-readable medium having stored thereon instructions that, when executed by one or more processors, cause an apparatus to perform the input method of the first aspect.
The embodiment of the application provides an input method, which can automatically provide reply corpora corresponding to the information of the conversation text for the user as reply candidate items, and further provide translation results corresponding to the reply corpora for the user as the reply candidate items on the basis, so that the reply candidate items provided by an intelligent reply function are enriched. Specifically, in the input method provided in the embodiment of the present application, target dialog context information is obtained first, then, by using a pre-trained dialog model, N (N is a positive integer) reply predictions corresponding to the target dialog context information are determined according to the obtained target dialog context information, then, translation results corresponding to at least one reply prediction among the N reply predictions are determined, and finally, the N reply predictions and the translation results corresponding to the at least one reply prediction are displayed as candidates. So, after determining the reply corpus that the above-mentioned information of target conversation corresponds based on the dialogue model, further translate the reply corpus that confirms, finally all show the user as the candidate item with reply corpus and the translation result that reply corpus corresponds, provide more diversified reply candidate item for the user so, the user selection of being convenient for promotes user's use and experiences.
Drawings
Fig. 1 is a schematic view of an application scenario of an input method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of an input method according to an embodiment of the present application;
fig. 3 is a schematic view of a first chat scenario provided in the embodiment of the present application;
fig. 4 is a schematic view of a second chat scenario provided in the embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a training principle of a dialogue model according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating display of candidate items according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an input device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an input device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a server device according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
In order to facilitate understanding of the technical solutions provided in the present application, the following description will first be made on the background of the present application.
The inventor finds that, in the course of studying the existing intelligent reply scheme, although the intelligent reply function in the current input method can automatically provide the reply corpus corresponding to the information on the above dialog for the user in the process of chatting, the provided reply corpus usually relates to only one language, for example, only provides the Chinese reply corpus for the user. However, in many application scenarios, the user may prefer to reply using reply corpora of other languages, for example, reply using english reply corpora, and at this time, the user still needs to manually input reply contents, which is poor in user experience.
In view of the foregoing technical problems, an embodiment of the present application provides an input method, which specifically includes: the method comprises the steps of firstly obtaining target dialogue upper-text information, then inputting the obtained target dialogue upper-text information into a pre-trained dialogue model, determining N reply linguistic data corresponding to the target dialogue upper-text information according to the target dialogue upper-text information by using the dialogue model, obtaining the dialogue model by training according to the historical reply linguistic data corresponding to the historical upper-text information and the historical reply linguistic data corresponding to the historical upper-text information, then determining a translation result corresponding to at least one reply linguistic data in the N reply linguistic data, and finally displaying the determined translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items. Therefore, on the basis of providing the reply corpus corresponding to the target conversation upper text information as the candidate item for the user, the translation result corresponding to the reply corpus is further provided for the user as the candidate item, so that the reply candidate items provided for the user by the intelligent reply function are enriched, the user can conveniently select the reply candidate item, and the use experience of the user is improved.
It should be understood that the input method provided in the embodiments of the present application may be specifically applied to devices with a natural language processing function, such as a terminal device, a server, and the like. The terminal device may be a smart phone, a computer, a Personal Digital Assistant (PDA), a tablet computer, or the like; the server may specifically be an application server or a Web server, and when specifically deployed, the server may be an independent server or a cluster server.
To facilitate understanding of the input method provided in the embodiments of the present application, the input method is explained and explained below with reference to the application scenario shown in fig. 1.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of an input method provided in an embodiment of the present application. As shown in fig. 1, the application scenario includes: the terminal device 110 and the server 120, the terminal device 110 and the server 120 can perform data interaction through a network; the terminal device 110 runs an input method client, and the terminal device 110 can send the obtained target dialog text information to the server 120 through the network; the server 120 is configured to execute the input method provided in the embodiment of the present application, so as to provide a selectable reply candidate for the user.
In specific implementation, the terminal device 110 may obtain the target dialog content and the dialog information before the target dialog content as the target dialog context information; for example, in the process of chatting between the user a and the user B, the user a receives the target conversation content "i want to go to sleep" sent by the user B, at this time, the terminal device 110 used by the user a may acquire several pieces of conversation information between the user a and the user B before "i want to sleep" and "i want to sleep" as the target conversation context information; further, the acquired target session context information is transmitted to the server 120 through the network.
After receiving the target dialogue text information sent by the terminal device 110, the server 120 inputs the received target dialogue text information into a pre-trained dialogue model, and determines N reply corpora corresponding to the target dialogue text information according to the target dialogue text information by using the dialogue model; still taking the example that the target dialog context information includes "i am going to sleep" and several pieces of dialog information between the user a and the user B before "i am going to sleep", the server 120 may determine a reply corpus for replying "i am going to sleep" such as "good night", lovely "," good night ", baby" and the like, using the dialog model. Further, the server 120 may select at least one reply corpus from the N reply corpuses determined by the dialog model, and translate the selected reply corpus to obtain translation results corresponding to the selected reply corpuses; for example, assuming that the reply corpus determined by the dialogue model includes "good night", love "and" good night, baby ", the server 120 may select" good night "as a translation object and translate the translation object into corresponding english" good night ". Finally, the server 120 takes the N reply corpora determined by the dialogue model and the translation result corresponding to at least one reply corpora selected from the N reply corpora as candidate items; for example, the reply linguistic data "good security", loved "and" good security ", and the translation result" good night "corresponding to" good security "determined by the dialogue model are all taken as candidate items; and sends these candidates to the terminal device 110 via the network.
After receiving the candidates sent by the server 120, the terminal device 110 correspondingly displays the candidates in the candidate display area, so that the user can select the corpus for replying the target dialog content from the candidates displayed in the candidate display area.
It should be understood that the application scenario shown in fig. 1 is only an example, and in an actual application, in addition to determining the candidate item through the way that the terminal device shown in fig. 1 interacts with the server, the terminal device may also determine the corresponding candidate item for the target dialog text message independently, that is, the terminal device may perform an operation of determining a reply corpus corresponding to the target dialog text message by using a dialog model independently, and an operation of translating the reply corpus, where no limitation is imposed on the application scenario to which the input method provided in the embodiment of the present application is applied.
The input method provided by the present application is described below by way of example.
Referring to fig. 2, fig. 2 is a schematic flow chart of an input method provided in the embodiment of the present application. The following describes the input method by taking the execution subject of the input method as an example of a server. As shown in fig. 2, the method comprises the steps of:
step 201: and acquiring the target dialogue upper information.
When a user chats with an instant messaging client loaded on a terminal device, an input method client loaded in the terminal device can acquire target conversation information received through the instant messaging client under the condition of acquiring related authority, acquire a plurality of pieces of conversation text information before the target conversation information, and send the target conversation information and the plurality of pieces of conversation text information before the target conversation information as target conversation text information to a server through a network so that the server acquires the target conversation text information.
It should be noted that the target session information refers to a message received by the terminal device through an instant messaging client, where the instant messaging client includes but is not limited to chat applications such as WeChat and QQ; for example, when the user a chats with the user B through WeChat, the user B receives the information "i want to sleep" sent by the user a, and the information "i want to sleep" can be regarded as the target dialog information.
It should be noted that, the present application does not limit the specific content of the target dialog information at all, that is, the target dialog information may include any chat content. In addition, the present application does not limit the expression form of the target dialog information, and the target dialog information may specifically include interrogative sentences, declarative sentences, imperative sentences, and the like. In addition, the format of the target dialog information is not limited at all, and the target dialog information may be in a text format, a picture format, a video format, a voice format, and other formats.
The several pieces of conversation-above information before the target conversation information refer to several chat records of the instant messaging client before receiving the target conversation information. For example, as shown in fig. 3, when the target dialog information is "i want to sleep", the dialog text information before the target dialog information specifically includes contents of "baby, dry tweed", "chase play", "baby watch play bar, i play a game to go", "go to bar", and the like.
It should be noted that the number of the session context information that the terminal device needs to acquire may be set according to actual requirements, for example, all chat records before the target session information needs to be acquired may be set as the session context information, and for example, a part of the chat records before the target session information needs to be acquired may be set as the session context information.
It should be further noted that, the chat scenario applicable in the embodiment of the present application is also not limited, and specifically may be a two-person chat scenario shown in fig. 3, or a multi-person chat scenario shown in fig. 4, that is, a group chat; in a two-person chat scene, the target conversation text information required to be acquired by the terminal device comprises the received target conversation information and chat records (namely conversation text information) of the two persons before the target conversation information; in a multi-user chat scenario, the target dialog context information required to be acquired by the terminal device includes the target dialog information received by the terminal device and the chat records (i.e. the dialog context information) in the group before the target dialog information.
It should be understood that, when the execution main body of the method provided in the embodiment of the present application is the terminal device, after the terminal device acquires the information on the target dialog in the above manner, the terminal device may directly execute the subsequent operation on the target dialog information without sending the target dialog information to the server.
Step 202: and determining N reply corpora corresponding to the target dialogue upper information according to the target dialogue upper information through a pre-trained dialogue model.
The method comprises the steps that after target conversation text information sent by terminal equipment is obtained by a server, the obtained target conversation text information is input into a pre-trained conversation model, so that the conversation model carries out prediction analysis based on the input target conversation text information and generates a corresponding output result, furthermore, the server determines N reply corpora which can be used for replying the target conversation information according to the output result generated by the conversation model, wherein N is an integer greater than or equal to 1.
It should be noted that the output result generated by the dialogue model may specifically include at least one corpus; the method may further include at least one corpus and its corresponding score, where the score corresponding to each corpus can represent a possibility that the corpus is selected by the user as the reply content of the target dialog information, and it should be understood that a higher corresponding score indicates a higher possibility that the corpus is selected by the user as the reply target dialog information, and a lower corresponding score indicates a lower possibility that the corpus is selected by the user as the reply target dialog information.
When the output result of the dialog model only includes at least one corpus, the server may directly take at least one corpus in the output result as a reply corpus corresponding to the target dialog text information, that is, the determined number N of the reply corpuses is equal to the number of corpuses included in the output result.
As an example, as shown in fig. 3, the terminal device goes to a bar with the target conversation information "i'm going to sleep" and the chat log "before" i'm going to sleep "sent from the user a to the user B; that baby watches the play bar, i play the game; … …' as the target dialogue upper message to the server; after receiving the target dialogue text information, the server inputs the target dialogue text information into a dialogue model, and the dialogue model analyzes and processes the target dialogue text information to generate the following output results: "good night, baby", "good night, Da or not", "good night, hugging", the server can directly use each corpus in the output result as the reply corpus.
Of course, the server may also optionally select N corpora as the reply corpora, and the manner in which the server selects the reply corpora is not limited herein.
When the output result of the dialogue model comprises at least one corpus and scores corresponding to the corpus, the server can select N reply corpuses from the corpuses included in the output result according to the scores corresponding to the corpuses in the output result, namely, the server can sort the scores corresponding to the corpuses in the output result in a descending order, and then select the corpuses corresponding to the scores arranged in the first N as the reply corpuses.
As an example, as shown in fig. 3, the terminal device goes to a bar with the target conversation information "i'm going to sleep" and the chat log "before" i'm going to sleep "sent from the user a to the user B; that baby watches the play bar, i play the game; … …' as the target dialogue upper message to the server; after receiving the target dialogue text information, the server inputs the target dialogue text information into a dialogue model, and the dialogue model analyzes and processes the target dialogue text information to generate the following output results: "evening and baby" - "96 minutes," evening and do "-" 85 minutes, "evening and hug" - "76 minutes," evening and "60 minutes; assuming that the reply corpus to be selected by the server includes 3, the server may sort the scores corresponding to the respective corpuses in the output result in a descending order, and select the three corpuses "good night, baby", "good night, hard how" and "good night, hugging" corresponding to the three scores in the top order as the reply corpus.
Of course, the server may not select the reply corpus according to the score corresponding to each corpus in the output result, that is, the server may directly use each corpus in the output result as the reply corpus, or may directly select N corpuses from the output result as the reply corpuses, where the method for selecting the reply corpus by the server is not limited.
It should be noted that the above dialog model is usually obtained by training according to historical previous information and historical reply corpus corresponding to the historical previous information, where the historical previous information specifically includes historical target dialog information and dialog previous information before the historical target dialog information, and the historical reply corpus is specifically reply content made by the user for the historical target dialog information. As shown in fig. 5, during specific training, historical information can be input into the initial dialogue model constructed in advance, the initial dialogue model processes the historical information on the basis of the BilSTM to obtain corresponding vectorization representation Encode, the Encode is input into a Hidden layer Hidden in the initial dialogue model, then, the obtained vectorization representation is utilized to execute the Classify task by the full connection layer, and finally the prediction reply corpus corresponding to the historical information is output, according to the difference between the predicted reply corpus and the historical reply corpus corresponding to the historical text information, adjusting the model parameters of the initial dialogue model, so as to utilize the historical information and the historical reply corpus corresponding to the historical information, and repeatedly and iteratively adjusting the model parameters of the initial dialogue model until the trained model reaches the training ending condition.
Step 203: and determining a translation result corresponding to at least one reply corpus in the N reply corpuses.
After the server determines N reply linguistic data based on the conversation model, at least one reply linguistic data is further selected from the N reply linguistic data, and the at least one reply linguistic data is translated into a specified language such as English, Korean, Japanese and the like, so that translation results corresponding to the at least one reply linguistic data are obtained.
During specific implementation, the server can determine a translation result corresponding to each at least one reply corpus according to the stored translation result pair; the server selects at least one reply corpus from the N reply corpuses, and then searches the translation result corresponding to each reply corpus based on the stored translation result pair.
Of course, in practical applications, the server may determine the translation result corresponding to each of the at least one reply corpus based on the translation result pair, and the server may also determine the translation result corresponding to each of the at least one reply corpus in other manners, for example, determine the translation result by using a translation model.
In a possible implementation manner, if the output result of the dialog model includes the corpora and the scores corresponding to the corpora, the server may perform descending order arrangement on the N reply corpora according to the score of each reply corpus in the N reply corpora, and further select M reply corpora with the top order (M is smaller than N) from the N reply corpora; and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Specifically, under the condition that the output result of the dialogue model comprises the corpora and the scores corresponding to the corpora, the server may perform descending ordering on the scores corresponding to the N reply corpora, and since the higher the score corresponding to the corpora is, the higher the probability that the corpora is selected as the reply target dialogue information by the user is represented, the server may select M reply corpora ranked ahead as the translation objects, that is, the server may select M reply corpora most likely to be selected as the reply target dialogue information by the user as the translation objects; and further, the server translates the M reply corpora into a specified language type to obtain translation results corresponding to the M reply corpora respectively.
As an example, it is assumed that the reply corpus determined by the server includes "good night, baby", "good night, no-iron", "good night, and hug", where the score corresponding to "good night, baby" is 96 points, "the score corresponding to" good night, no-iron "is 85 points, and the score corresponding to" good night, hug "is 76 points; assuming that M is equal to 1, it indicates that the server can only select 1 reply corpus from the three reply corpuses as a translation object, in this case, the server can perform descending order sorting on the scores corresponding to the three reply corpuses, and finally determine the reply corpus "good night, baby" with the highest score as a translation object, and translate the translation object into english to obtain a translation result "good night, baby".
It should be understood that M may be any positive integer smaller than N in practical applications, and the application does not limit the number of translation objects. In addition, the server can sort the reply corpuses in a descending order according to the scores, can sort the reply corpuses in an ascending order according to the scores, and selects M reply corpuses which are sorted later to translate.
In another possible implementation manner, the server may select several reply corpora commonly used by the user to translate according to the user's chat habits. Namely, the server can select M reply linguistic data commonly used by the current login user from the N reply linguistic data; and further determining a translation result corresponding to each reply corpus in the M reply corpuses.
It should be noted that, for each user who has registered the input method client, the server records the usage of the reply corpus of the user based on the usage of the input method of the user, for example, records, for each user, the respective historical usage times corresponding to the used reply corpuses. After the server determines the N reply corpora based on the dialogue model, the server may further call the respective historical usage times corresponding to the respective reply corpora recorded by the current login user, determine the respective historical usage times corresponding to the N reply corpora, further perform descending order sorting on the N reply corpora according to the respective historical usage times corresponding to the N reply corpora, select M reply corpora that are sorted in the front as translation objects, translate the M reply corpora into a specified language, and obtain the respective corresponding translation results.
As an example, it is assumed that the reply corpus determined by the server includes "good night, baby", "good night, no-iron", "good night, and hug", where the historical usage times corresponding to "good night, baby" is 52 times, "good night, no-iron" is 36 times, "good night, and hug" is 20 times; assuming that M is equal to 1, it indicates that the server can only select 1 reply corpus from the three reply corpuses as a translation object, in this case, the server can sort the historical use times corresponding to the three reply corpuses in a descending order, and finally determine "good night, baby" with the largest historical use time as a translation object, and translate the translation object into english to obtain a translation result "good night, baby".
It should be understood that M may be any positive integer smaller than N in practical applications, and the application does not limit the number of translation objects. In addition, the server can perform descending ordering on the reply linguistic data according to the historical use times, perform ascending ordering on the reply linguistic data according to the historical use times, and select M reply linguistic data which are ordered later to be translated.
In addition, the server may reflect the usage habits of the user on the reply corpus by using the historical usage times of the reply corpus, and may also reflect the usage habits of the user on the reply corpus by using other data, such as historical usage frequency, etc., where no limitation is made on the data used for reflecting the usage habits of the user on the reply corpus, that is, no limitation is made on the measurement data used for evaluating whether the reply corpus is commonly used by the user.
In yet another possible implementation manner, the server may determine translation results corresponding to any M reply corpuses in the N reply corpuses. That is, the server may select any M reply corpuses from the N reply corpuses as translation objects, and translate the M reply corpuses into a specified language type to obtain a translation result.
As an example, assuming that the reply corpus determined by the server includes "good night, baby", "good night, No. of lap", "good night, and clasping", and the preset M is equal to 1, the server may select "good night, baby" as the translation object, may select "good night, No. of lap" as the translation object, and may further select "good night, clasping" as the translation object, and then translates the selected translation object into the corresponding translation result.
It should be noted that the above three possible implementation manners are only examples, and in practical applications, the server may use all the N reply corpuses as translation objects, and correspondingly translate all the N reply corpuses; and selecting part of the reply corpora from the N reply corpora as translation objects, and correspondingly translating the selected part of the reply corpora, wherein when the translation objects are specifically selected, the server can adopt the three implementation modes and can also adopt other implementation modes, and the application does not limit the implementation mode of selecting the translation objects by the server.
It should be noted that, in practical applications, when the server translates at least one reply corpus, it is further required to determine a specified language type, that is, determine a language type to which a translation result belongs.
In a possible implementation manner, the server may determine, according to a common foreign language type of the currently logged-in user, a translation result of the common foreign language type corresponding to each of at least one reply corpus of the N reply corpuses.
Specifically, for each user who has registered the input method client, the server records the language type used by the user and correspondingly records the historical use times corresponding to each language type based on the use of the user for the input method; for example, the server may record the language types used by the registered user, including chinese, english, and japanese, according to the use of the input method by the registered user, where the historical use number corresponding to chinese is 1600 times, the historical use number corresponding to english is 500 times, and the use number corresponding to japanese is 50 times.
When the server determines the language type on which the translation operation is to be executed, the language type recorded for the current login user and the historical use times corresponding to each language type can be called, and the common foreign language type of the current login user is determined based on the language type. Specifically, the server may exclude the language type to which the reply corpus belongs, and further determine, based on the historical usage times corresponding to the respective other language types used by the current login user, the language type with the largest historical usage times as the common foreign language type of the current login user, and further correspondingly translate at least one reply corpus selected from the N reply corpuses into a corpus belonging to the common foreign language type as a translation result.
As an example, it is assumed that the language type used by the server for the current login user includes chinese, english, and japanese, where the historical usage number corresponding to chinese is 1600 times, the historical usage number corresponding to english is 500 times, and the usage number corresponding to japanese is 50 times; because the reply corpus determined by the server is the Chinese corpus, the server can determine the frequently-used foreign language type of the current login user according to the historical using times corresponding to English and the historical using times corresponding to Japanese; because the historical usage times corresponding to English are higher than those corresponding to Japanese, English can be used as the common foreign language type of the current login user, and further, all the selected reply corpora are translated into corresponding English corpora.
In another possible implementation manner, the server may determine the target foreign language type of the current login user according to the current interaction information of the current login user; and then, according to the target foreign language type, determining a translation result of the target foreign language type corresponding to at least one reply corpus in the N reply corpuses.
Specifically, when the server determines the language type on which the translation operation is to be executed, the server may obtain current interaction information of the current login user, where the current interaction information refers to interaction information in a preset time period related in a chat session in which the current login user is located, and may include information sent by the current login user and information sent by other users in the chat session; furthermore, the target foreign language type is determined according to the current interaction information, specifically, the language type with the largest occurrence frequency in the current interaction information except the language type corresponding to the reply corpus can be determined as the target foreign language type, the language type used by the current login user except the language type corresponding to the reply corpus can be determined as the target foreign language type, the language type used by other users in the chat session except the language type corresponding to the reply corpus can be determined as the target foreign language type, and the determination method of the target foreign language type is not limited at all. And correspondingly translating at least one reply corpus selected from the N reply corpuses into a corpus belonging to the target foreign language type as a translation result.
As an example, the server obtains current interaction information of a current login user, wherein the current interaction information includes information "baby", "dry woollen" sent by the user B and information "play after play" sent by the user a; because the language type corresponding to the reply corpus is Chinese, the server can take the language type with the most occurrence times, namely English, except Chinese, in the current interactive information as the target language type; the language type used by the currently logged-in user B other than chinese, that is, english, may also be used as the target language type. And further, translating all the selected reply corpora into corresponding English corpora. It should be understood that, in practical applications, in addition to determining the specified language type based on which the translation operation is performed in the above manner, the server may also determine the specified language type based on which the translation operation is performed in other manners, for example, a certain language type is set as the specified language type by default, or the specified language type is determined based on the setting of the user, and the manner of determining the specified language type is not limited in this application.
In addition, in practical applications, the server may translate the selected reply corpus into multiple language types, that is, multiple corresponding translation results are obtained for the same reply corpus translation, and each translation result belongs to a different language type, which does not limit the number of the specified language types.
Step 204: and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
The server takes the N reply corpora obtained in the step 202 and the translation result corresponding to at least one reply corpora obtained in the step 203 as candidate items, the candidate items are sent to the terminal equipment through the network, and after the terminal equipment receives the candidate items sent by the server, the candidate items are correspondingly displayed in a reply candidate item display area, so that the user can select proper reply content from the reply candidate item display area to reply the target dialogue information.
In a possible implementation manner, if the output result of the dialogue model includes the corpora and the scores corresponding to the corpora, the server may perform descending order sorting on the N reply corpora according to the score corresponding to each reply corpus in the N reply corpora to obtain a first sorting result; and then, according to the first sequencing result, each reply corpus in the N reply corpuses is used as a first-class candidate item to be sequentially displayed, and a translation result corresponding to at least one reply corpus in the N reply results is used as a second-class candidate item to be displayed at the adjacent position of the corresponding first-class candidate item.
Specifically, the server may determine a display order of the N reply corpora according to scores corresponding to the N reply corpora output by the dialog model, that is, determine that the N reply corpora are displayed from top to bottom in an order from high to low according to the scores; in addition, for the translation result corresponding to at least one reply corpus in the candidate items, the server may determine to display the translation result at a position adjacent to its corresponding reply corpus, such as below the corresponding reply corpus, to the right of the corresponding reply corpus, and so on. The server sends the candidate items to the terminal equipment, and simultaneously sends the display sequence corresponding to each candidate item to the terminal equipment, so that the terminal equipment displays each candidate item in the reply candidate item display area based on the display sequence corresponding to each candidate item.
As an example, it is assumed that the candidates determined by the server include "good night, baby", "good night, good how", "good night, hug", and "good night, baby" corresponding to the translation result "good night, baby", and the server determines that "good night, baby", "good night, hug", and "good night, baby" should be displayed in order of "good night, baby", "good night, good how", "good night, hug", and "good night, baby" in the order from top to bottom, and displays "good night, baby" at the adjacent position of "good night, baby". As shown in fig. 6, in the reply candidate display area, "good night, baby", "good night, can", "good night, hug", and "good night, baby" are displayed in order from top to bottom, and "good night, baby" is displayed below "good night, baby", that is, "good night, baby", and "good night, can" are displayed.
It should be understood that, in practical applications, the adjacent position corresponding to the reply corpus may also be other positions, such as the right region laterally aligned with the reply corpus, the upper portion of the reply corpus, and the like, and the application is not specifically limited to the adjacent position corresponding to the reply corpus (i.e., the position where the translation result corresponding to the reply corpus is displayed).
It should be noted that, in practical applications, the server may also directly send the scores corresponding to the N reply corpora to the terminal device, so that the terminal device determines, according to the scores corresponding to the N reply corpora, a display sequence corresponding to the translation results corresponding to the N reply corpora and the at least one reply corpora.
In another possible implementation manner, the server may perform descending order sorting on the translation results corresponding to at least one of the N reply corpuses and the N reply corpuses according to the usage frequency of the current login user on the translation results corresponding to at least one of the N reply corpuses and the N reply corpuses, so as to obtain a second sorting result; and then, according to the second sorting result, taking the translation result corresponding to each of the N reply linguistic data and at least one reply linguistic data in the N reply linguistic data as a candidate item, and sequentially displaying the candidate items.
Specifically, for each user who has registered the input method client, the server records the usage of the reply corpus of the user based on the usage of the input method of the user, specifically including the historical usage frequency of the reply corpus, where the historical usage frequency of the reply corpus includes both the usage frequency of the Chinese reply corpus of the user and the usage frequency of the foreign language reply corpus of the user. In this case, the server may call the historical usage frequency of the reply corpus recorded for the current login user, determine the historical usage frequency corresponding to each of the N reply corpuses and the historical usage frequency of the translation result corresponding to the at least one reply corpus, and then perform descending order sorting on the translation results corresponding to the N reply corpuses and the at least one reply corpus according to the historical usage frequency corresponding to each of the N reply corpuses and the historical usage frequency of the translation result corresponding to the at least one reply corpus to obtain a second sorting result; and the server sends the second sorting result and the candidate items to the terminal equipment together, so that the terminal equipment can display the N reply linguistic data and the translation result corresponding to at least one reply linguistic data in sequence in a reply candidate item display area based on the second sorting result.
As an example, it is assumed that the candidates determined by the server include "good, baby", "good, can", "good, hug", and "good, baby" corresponding to the translation result "good night, baby", where the historical frequency of use corresponding to "good, baby" is 52 times, "good, can" is 36 times, "good, hug" is 20 times, "good night, hug" is 43 times; the server determines that the second sorting result is that 'good night, baby', 'good night', and 'good night' are displayed from top to bottom in sequence according to the history use frequency corresponding to each candidate item; and generating each candidate item and the second sorting result to the terminal equipment, and sequentially displaying the 'good night, baby', good night, and 'good night' and 'hugging' in the interface shown by the corresponding map 6 by the terminal equipment from top to bottom in the reply candidate item display area.
It should be noted that, in practical applications, the server may also directly send the N reply corpora and the respective historical frequency of use of the translation result corresponding to the at least one reply corpus to the terminal device, so that the terminal device determines a second ranking result according to the respective historical frequency of use of the translation result corresponding to the N reply corpora and the at least one reply corpus, and displays the candidate items based on the second ranking result.
It should be understood that, in practical applications, the server or the terminal device may also determine the display order corresponding to each candidate item in other manners, and the implementation manner of determining the display order is not limited in this application.
According to the input method, on the basis of providing the reply corpus corresponding to the target dialogue upper-text information as the candidate item for the user, the translation result corresponding to the reply corpus is further provided for the user as the candidate item, so that the reply candidate items provided for the user by the intelligent reply function are enriched, the user can conveniently select the reply candidate item, and the use experience of the user is improved.
Based on the input method provided by the above method embodiment, the embodiment of the present application further provides an input device, which is explained and explained with reference to the drawings.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an input device according to an embodiment of the present application.
The input device provided by the embodiment of the application comprises:
an obtaining module 701, configured to obtain information on a target dialog;
a reply corpus determining module 702, configured to determine, according to the target dialog context information, N reply corpuses corresponding to the target dialog context information through a pre-trained dialog model, where N is a positive integer; the dialogue model is obtained according to historical previous information and historical reply training corresponding to the historical previous information;
a translation result determining module 703, configured to determine a translation result corresponding to each of at least one of the N reply corpuses;
a candidate item display module 704, configured to display, as candidate items, translation results corresponding to the N reply corpora and the at least one reply corpus.
In a possible implementation manner, the translation result determining module 703 includes:
a first selection submodule, configured to perform descending order arrangement on the N reply corpuses according to a score of each reply corpus in the N reply corpuses, and select M reply corpuses with a top order from the N reply corpuses, where M is smaller than N;
and the first determining submodule is used for determining a translation result corresponding to each reply corpus in the M reply corpuses.
In a possible implementation manner, the translation result determining module 703 includes:
a second selection submodule, configured to select M reply corpora frequently used by the current login user from the N reply corpora, where M is smaller than N;
and the second determining submodule is used for determining a translation result corresponding to each reply corpus in the M reply corpuses.
In a possible implementation manner, the translation result determining module 703 is specifically configured to determine a translation result corresponding to one reply corpus of the N reply corpuses.
In a possible implementation manner, the translation result determining module 703 is specifically configured to determine, according to a common foreign language type of a currently logged-in user, a translation result of the common foreign language type corresponding to each of at least one of the N reply corpuses.
In a possible implementation manner, the translation result determining module 703 is specifically configured to determine a target foreign language type of a current login user according to current interaction information of the current login user, and determine a translation result of the target foreign language type corresponding to each of at least one of the N reply corpuses according to the target foreign language type of the current login user.
In one possible implementation manner, the candidate item display module 704 includes:
the first sequencing submodule is used for performing descending sequencing on the N reply linguistic data according to the score corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sequencing result;
and the candidate item display sub-module is used for sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at an adjacent position of the corresponding first-class candidate item.
In one possible implementation manner, the candidate item display module 704 includes:
the second sorting submodule is used for performing descending sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and the candidate item display sub-module is used for sequentially displaying the N reply linguistic data and a translation result corresponding to at least one reply linguistic data in the N reply linguistic data as candidate items according to the second sorting result.
It should be noted that, for specific implementation of each module in this embodiment, reference may be made to the foregoing method embodiment, and this embodiment is not described herein again.
Fig. 8 shows a block diagram of an input device 800. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices 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 or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a 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 an input signal from a 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 boundary of a 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 facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface provides an interface between the processing component 802 and peripheral interface modules, which may be 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.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. 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 a light 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 acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may 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 associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
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, micro-controllers, microprocessors or other electronic components for performing the following methods:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained by training according to historical previous information and historical reply corpora corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
according to the grade of each reply corpus in the N reply corpuses, performing descending order arrangement on the N reply corpuses, and selecting M reply corpuses with the front order from the N reply corpuses, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
selecting M reply linguistic data commonly used by the current login user from the N reply linguistic data, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining a translation result corresponding to any reply corpus in the N reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining a translation result of the common foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the common foreign language type of the current login user.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
determining the target foreign language type of the current login user according to the current interaction information of the current login user;
and determining a translation result of the target foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the target foreign language type of the current login user.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
performing descending sorting on the N reply linguistic data according to the scores corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sorting result;
and sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at the adjacent position of the corresponding first-class candidate item.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and at least one reply linguistic data in the N reply linguistic data, performing descending order sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and sequentially displaying the N replying linguistic data and the translation result corresponding to at least one replying linguistic data in the N replying linguistic data as candidate items according to the second sorting result.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform an input method, the method comprising:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained by training according to historical previous information and historical reply corpora corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
according to the grade of each reply corpus in the N reply corpuses, performing descending order arrangement on the N reply corpuses, and selecting M reply corpuses with the front order from the N reply corpuses, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to at least one reply corpus of the N reply corpuses includes:
selecting M reply linguistic data commonly used by the current login user from the N reply linguistic data, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining a translation result corresponding to any reply corpus in the N reply corpuses.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
and determining a translation result of the common foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the common foreign language type of the current login user.
Optionally, the determining a translation result corresponding to each of at least one of the N reply corpuses includes:
determining the target foreign language type of the current login user according to the current interaction information of the current login user;
and determining a translation result of the target foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the target foreign language type of the current login user.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
performing descending sorting on the N reply linguistic data according to the scores corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sorting result;
and sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at the adjacent position of the corresponding first-class candidate item.
Optionally, the displaying, as candidate items, translation results corresponding to the N reply corpora and at least one reply corpus in the N reply corpora, includes:
according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and at least one reply linguistic data in the N reply linguistic data, performing descending order sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and sequentially displaying the N replying linguistic data and the translation result corresponding to at least one replying linguistic data in the N replying linguistic data as candidate items according to the second sorting result.
Fig. 9 is a schematic structural diagram of a server in an embodiment of the present invention. The server 900 may vary widely in configuration or performance and may include one or more Central Processing Units (CPUs) 922 (e.g., one or more processors) and memory 932, one or more storage media 930 (e.g., one or more mass storage devices) storing applications 942 or data 944. Memory 932 and storage media 930 can be, among other things, transient storage or persistent storage. The program stored on the storage medium 930 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, a central processor 922 may be provided in communication with the storage medium 930 to execute a series of instruction operations in the storage medium 930 on the server 900.
The terminal 900 can also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input-output interfaces 956, one or more keyboards 956, and/or one or more operating systems 941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An input method, characterized in that the method comprises:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained by training according to historical previous information and historical reply corpora corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
2. The input method according to claim 1, wherein the determining the translation result corresponding to at least one of the N reply corpuses comprises:
according to the grade of each reply corpus in the N reply corpuses, performing descending order arrangement on the N reply corpuses, and selecting M reply corpuses with the front order from the N reply corpuses, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
3. The input method according to claim 1, wherein the determining the translation result corresponding to at least one of the N reply corpuses comprises:
selecting M reply linguistic data commonly used by the current login user from the N reply linguistic data, wherein M is smaller than N;
and determining a translation result corresponding to each reply corpus in the M reply corpuses.
4. The input method according to claim 1, wherein the determining the translation result corresponding to each of at least one of the N reply corpuses comprises:
and determining a translation result corresponding to any M reply linguistic data in the N reply linguistic data.
5. The input method according to claim 1, wherein the determining the translation result corresponding to each of at least one of the N reply corpuses comprises:
and determining a translation result of the common foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the common foreign language type of the current login user.
6. The input method according to claim 1, wherein the determining the translation result corresponding to each of at least one of the N reply corpuses comprises:
determining the target foreign language type of the current login user according to the current interaction information of the current login user;
and determining a translation result of the target foreign language type corresponding to at least one reply corpus in the N reply corpuses according to the target foreign language type of the current login user.
7. The input method according to claim 1, wherein said displaying the translation result corresponding to each of the N reply corpora and at least one of the N reply corpora as a candidate, comprises:
performing descending sorting on the N reply linguistic data according to the scores corresponding to each reply linguistic data in the N reply linguistic data to obtain a first sorting result;
and sequentially displaying each reply corpus in the N reply corpuses as a first-class candidate item according to the first sequencing result, and displaying a translation result corresponding to at least one reply corpus in the N reply corpuses as a second-class candidate item at the adjacent position of the corresponding first-class candidate item.
8. The input method according to claim 1, wherein said displaying the translation result corresponding to each of the N reply corpora and at least one of the N reply corpora as a candidate, comprises:
according to the use frequency of the current login user on the translation results corresponding to the N reply linguistic data and at least one reply linguistic data in the N reply linguistic data, performing descending order sorting on the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data in the N reply linguistic data to obtain a second sorting result;
and sequentially displaying the N replying linguistic data and the translation result corresponding to at least one replying linguistic data in the N replying linguistic data as candidate items according to the second sorting result.
9. An input device, the device comprising:
the acquisition module is used for acquiring the information of the target conversation;
the reply corpus determining module is used for determining N reply corpuses corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained according to historical previous information and historical reply training corresponding to the historical previous information;
a translation result determining module, configured to determine a translation result corresponding to each of at least one of the N reply corpuses;
and the candidate item display module is used for displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
10. An input apparatus comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for:
acquiring the information of the target conversation;
determining N reply corpora corresponding to the target dialogue upper-text information according to the target dialogue upper-text information through a pre-trained dialogue model, wherein N is a positive integer; the dialogue model is obtained according to historical previous information and historical reply training corresponding to the historical previous information;
determining a translation result corresponding to at least one reply corpus in the N reply corpuses;
and displaying the translation results corresponding to the N reply linguistic data and the at least one reply linguistic data as candidate items.
CN201910907038.XA 2019-09-24 2019-09-24 Input method, device, equipment and storage medium Pending CN112631435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910907038.XA CN112631435A (en) 2019-09-24 2019-09-24 Input method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910907038.XA CN112631435A (en) 2019-09-24 2019-09-24 Input method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112631435A true CN112631435A (en) 2021-04-09

Family

ID=75282860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910907038.XA Pending CN112631435A (en) 2019-09-24 2019-09-24 Input method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112631435A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356173A (en) * 2021-12-06 2022-04-15 科大讯飞股份有限公司 Message reply method and related device, electronic equipment and storage medium
CN114666293A (en) * 2022-03-21 2022-06-24 北京明略昭辉科技有限公司 Session assistance method, device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356173A (en) * 2021-12-06 2022-04-15 科大讯飞股份有限公司 Message reply method and related device, electronic equipment and storage medium
CN114666293A (en) * 2022-03-21 2022-06-24 北京明略昭辉科技有限公司 Session assistance method, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US11622141B2 (en) Method and apparatus for recommending live streaming room
CN110874145A (en) Input method and device and electronic equipment
CN108038102B (en) Method and device for recommending expression image, terminal and storage medium
CN109582768B (en) Text input method and device
US11335348B2 (en) Input method, device, apparatus, and storage medium
CN108345625B (en) Information mining method and device for information mining
CN111797262A (en) Poetry generation method and device, electronic equipment and storage medium
CN112631435A (en) Input method, device, equipment and storage medium
CN109814730B (en) Input method and device and input device
CN112445906A (en) Method and device for generating reply message
CN111835617B (en) User head portrait adjusting method and device and electronic equipment
CN110213062B (en) Method and device for processing message
CN111984767A (en) Information recommendation method and device and electronic equipment
CN110895558B (en) Dialogue reply method and related device
CN112988956A (en) Method and device for automatically generating conversation and method and device for detecting information recommendation effect
CN110858099A (en) Candidate word generation method and device
CN110908523A (en) Input method and device
CN111178086B (en) Data processing method, device and medium
CN113127613B (en) Chat information processing method and device
CN113901832A (en) Man-machine conversation method, device, storage medium and electronic equipment
CN113409766A (en) Recognition method, device for recognition and voice synthesis method
CN109388250B (en) Information recommendation method and device and electronic equipment
CN113589949A (en) Input method and device and electronic equipment
CN111339263A (en) Information recommendation method and device and electronic equipment
CN111831132A (en) Information recommendation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination