Method, device, electronic device, and storage medium for implementing conversation translation
Through the conversational translation method of real-time translation and format synchronization, the problem of low communication efficiency in cross-language collaborative office scenarios is solved, and more efficient cross-language communication and collaborative office work is achieved.
Patent Information
- Application Number
- CN202210571461.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-05-24
AI Technical Summary
In the cross-language collaborative office scenario, due to language barriers, communication efficiency and office efficiency between employees are reduced.
Provide a method to realize session translation, which improves the efficiency of cross-language communication by translating the user's input text in the session in real time and keeps the translated text consistent with the text format of the input text.
Through real-time translation and format synchronization, users' expression intentions can be better preserved, and users' communication efficiency and collaborative office efficiency can be improved in cross-language communication scenarios.
Smart Images

Figure CN114841178B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of text processing technology, and in particular to a method, device, electronic device, and storage medium for implementing conversation translation. Background Art
[0002] With the rapid development of global collaborative office scenarios, more and more employees in large multinational companies are collaborating through collaborative office software. These employees are usually distributed in different countries / regions and use different languages. Most collaborative office software integrates multiple office applications such as instant messaging, cloud documents, audio and video conferencing, etc., which greatly improves the efficiency of collaborative office between employees in different countries / regions of multinational companies.
[0003] In a cross-language collaborative office scenario, when employees from different countries / regions collaborate through collaborative office software, they may be limited by language barriers, which reduces communication efficiency and office efficiency. For example, when employee A who speaks language X communicates with employee B who speaks language Y through collaborative office software, since A and B are not familiar with each other's language, A needs to translate the content to be communicated from language X to language Y through translation software before sending it to B. This additional translation processing operation reduces the communication efficiency between A and B, and thus reduces office efficiency.
[0004] Based on this, it is necessary to provide a technical solution to improve the communication efficiency between users in cross-language communication scenarios and improve the collaborative office efficiency of users. Summary of the invention
[0005] The embodiments of this specification provide a method, device, electronic device, and storage medium for implementing conversation translation, which can translate the input text of the user in the conversation in real time to obtain a translated text, and keep the text format of the translated text consistent with the input text. With the help of the format synchronization capability between the translated text and the input text, the user's expression intention can be better retained in the translated text, the communication efficiency between users in cross-language communication scenarios can be improved, and the collaborative office efficiency of users can be improved.
[0006] In a first aspect, an embodiment of the present specification provides a method for implementing conversation translation, including:
[0007] According to an input operation of a user in a conversation interface, displaying a corresponding input text in an input area of the conversation interface, wherein the input text has a first text format;
[0008] Obtaining a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0009] The translated text is displayed in a translated text display area of the conversation interface.
[0010] In a second aspect, an embodiment of the present specification provides a device for implementing conversation translation, including:
[0011] A first display unit, configured to display corresponding input text in an input area of the conversation interface according to an input operation of a user in the conversation interface, wherein the input text has a first text format;
[0012] A text acquisition unit, used for acquiring a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0013] The second display unit is configured to display the translated text in the translated text display area of the conversation interface.
[0014] In a third aspect, an embodiment of the present specification provides an electronic device, including:
[0015] processor; and,
[0016] A memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to implement the steps of the method described in the first aspect above.
[0017] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the method described in the first aspect above.
[0018] In the embodiment of this specification, according to the input operation of the user in the conversation interface, the corresponding input text is displayed in the input area of the conversation interface, the input text has a first text format, and the translation text of the input text is obtained, and the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text, and the translation text is displayed in the translation text display area of the conversation interface. It can be seen that in this embodiment, the input text of the user in the conversation can be translated in real time to obtain the translation text, and the text format of the translation text is kept consistent with that of the input text. With the help of the format synchronization capability between the translation text and the input text, the user's expression intention can be better retained in the translation text, the communication efficiency between users in the cross-language communication scenario is improved, and the collaborative office efficiency of users is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0020] Figure 1 A flowchart of a method for implementing conversation translation provided in an embodiment of this specification;
[0021] Figure 2a A schematic diagram of a scenario of conversation translation provided in an embodiment of this specification;
[0022] Figure 2b A schematic diagram of a scenario of conversation translation provided by another embodiment of this specification;
[0023] Figure 2c A schematic diagram of a scenario of conversation translation provided by another embodiment of this specification;
[0024] Figure 2d A schematic diagram of a scenario of conversation translation provided by another embodiment of this specification;
[0025] Figure 2e A schematic diagram of a scenario of conversation translation provided by another embodiment of this specification;
[0026] Figure 3 A flowchart of a method for implementing conversation translation provided by another embodiment of this specification;
[0027] Figure 4 A schematic diagram of the structure of a device for implementing conversation translation provided in an embodiment of this specification;
[0028] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0030] An embodiment of the present specification provides a method for implementing conversation translation, which can translate the input text of the user in the conversation in real time to obtain a translated text, and keep the text format of the translated text consistent with the input text. With the help of the format synchronization capability between the translated text and the input text, the user's expression intention can be better retained in the translated text, thereby improving the communication efficiency between users in cross-language communication scenarios and improving the users' collaborative office efficiency.
[0031] Figure 1 A flowchart of a method for implementing conversation translation provided in an embodiment of this specification is shown in FIG. Figure 1 As shown, the process includes the following steps:
[0032] Step S102: displaying corresponding input text in an input area of the conversation interface according to an input operation of the user in the conversation interface, where the input text has a first text format;
[0033] Step S104, obtaining a translation text of the input text, the translation text having a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0034] Step S106: displaying the translated text in the translated text display area of the conversation interface.
[0035] In the embodiment of this specification, according to the input operation of the user in the conversation interface, the corresponding input text is displayed in the input area of the conversation interface, the input text has a first text format, and the translation text of the input text is obtained, and the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text, and the translation text is displayed in the translation text display area of the conversation interface. It can be seen that in this embodiment, the input text of the user in the conversation can be translated in real time to obtain the translation text, and the text format of the translation text is kept consistent with that of the input text. With the help of the format synchronization capability between the translation text and the input text, the user's expression intention can be better retained in the translation text, the communication efficiency between users in the cross-language communication scenario is improved, and the collaborative office efficiency of users is improved.
[0036] In one embodiment of the present disclosure, the conversation is a conversation in an instant messaging application integrated with collaborative office software. In the above step S102, the corresponding input text is displayed in the input area of the conversation interface according to the user's input operation in the conversation interface in the instant messaging application integrated with the collaborative office software.
[0037] In other embodiments, the session may also be a session in other scenarios, such as a session in an independent instant messaging application, a session in a video or audio conference, a session for communication between different users in various platform applications (such as an e-commerce platform, a video platform, a social platform), etc. Among them, for an e-commerce platform, different sellers, different buyers, sellers and buyers, buyers and platform customer service, and sellers and platform customer service can all communicate through a session. For a video platform, each video delivery blogger, video delivery blogger and platform customer service can all communicate through a session. For a social platform, each platform user, platform user and platform customer service can all communicate through a session. Even, a session can also be a session entered by a user when sending a text message or multimedia message through a mobile phone base station. Therefore, in step S102, the corresponding input text can be displayed in the input area of the session interface according to the user's input operation in the session interface of any session. Among them, the input text has a first text format.
[0038] In one embodiment, in the above step S102, according to the input operation of the user in the conversation interface, the corresponding input text is displayed in the input area of the conversation interface, specifically:
[0039] (a1) according to the text input operation of the user in the conversation interface, obtaining the user's input text and displaying it in the input area of the conversation interface;
[0040] or,
[0041] (a2) According to the audio input operation of the user in the conversation interface, the audio data input by the user is obtained, the audio data is converted into text to obtain input text, and the input text is displayed in the input area of the conversation interface.
[0042] In one case, the user can input text in the conversation interface, and according to the text input operation of the user in the conversation interface, the user's input text is obtained and displayed in the input area of the conversation interface. In this case, the first text format is a text format customized for the input text when the user edits the input text, and the user can perform an input operation to input text through the rich text input box or the plain text input box provided by the conversation.
[0043] In another case, the user can input audio data in the conversation interface, then the audio data input by the user is obtained, the audio data is converted into text to obtain input text, and the input text is displayed in the input area of the conversation interface. In this case, the user can perform an input operation through the voice input control provided by the conversation to input audio data.
[0044] In the case where the user inputs audio data, considering that the audio data does not have a text format, in one embodiment, after the audio data is converted into text to obtain the input text, the first text format of the converted input text is set to the default format of the session, or to the format pre-configured by the user in the session, or, after the input text is converted, the user adjusts the format of the input text based on the format setting tool in the session interface.
[0045] In which, when the first text format is a format pre-configured by the user in the conversation, an interface for user-defined formats may also be provided, through which the user-defined format is obtained and the user-defined format is set as the first text format corresponding to the voice input situation.
[0046] It can be seen that in this embodiment, taking into account the situation that the audio data does not have a text format, after the audio data input by the user is converted into text to obtain the input text, the first text format of the converted input text can be set to the default format provided by the session, or to the format pre-configured by the user in the session, so that when the user inputs audio data, the corresponding first text format is set for the input text corresponding to the audio data.
[0047] Figure 2a A schematic diagram of a scenario of conversation translation provided in an embodiment of this specification, such as Figure 2a As shown, in a scenario, taking collaborative office software on a mobile phone as an example, a user can input a text-based conversation message through a plain text input box in an instant messaging application integrated with the collaborative office software. When the user inputs a text-based conversation message, the instant messaging application can translate the text-based conversation message input by the user into the language used by the conversation partner in real time to obtain a translated text, and set the second text format of the translated text to be the same as the first text format of the user's input text, and display the translated text in the translated text display area. The figure takes the language used by the conversation partner as English as an example for explanation.
[0048] Figure 2b A schematic diagram of a conversation translation scenario provided by another embodiment of this specification, such as Figure 2b As shown, in a scenario, taking collaborative office software on a mobile phone as an example, a user can input a text-based conversation message through a rich text input box in an instant messaging application integrated with the collaborative office software. When the user inputs a text-based conversation message, the instant messaging application can translate the text-based conversation message input by the user into the language used by the conversation partner in real time to obtain a translated text, and set the second text format of the translated text to be the same as the first text format of the user's input text, and display the translated text in the translated text display area. The figure takes the language used by the conversation partner as English as an example for explanation.
[0049] Figure 2c A schematic diagram of a conversation translation scenario provided by another embodiment of this specification, such as Figure 2c As shown, in a scenario, taking collaborative office software on the computer side as an example, a user can input a text-based conversation message through a plain text input box in an instant messaging application integrated with the collaborative office software. When the user inputs a text-based conversation message, the instant messaging application can translate the text-based conversation message input by the user into the language used by the conversation partner in real time to obtain a translated text, and set the second text format of the translated text to be the same as the first text format of the user's input text, and display the translated text in the translated text display area. The figure takes the language used by the conversation partner as English as an example for explanation.
[0050] Figure 2d A schematic diagram of a conversation translation scenario provided by another embodiment of this specification, such as Figure 2d As shown, in a scenario, taking collaborative office software on the computer side as an example, a user can input a text-based conversation message through a rich text input box in an instant messaging application integrated with the collaborative office software. When the user inputs a text-based conversation message, the instant messaging application can translate the text-based conversation message input by the user into the language used by the conversation partner in real time to obtain a translated text, and set the second text format of the translated text to be the same as the first text format of the user's input text, and display the translated text in the translated text display area. The figure takes the language used by the conversation partner as English as an example for explanation.
[0051] Here is a brief explanation. The difference between a plain text input box and a rich text data box is that a plain text input box cannot input pictures, and cannot perform complex formatting on text, such as writing serial numbers, etc. A rich text data box can insert pictures, and can perform complex formatting on text, meeting formatting requirements such as writing serial numbers and line breaks. A rich text input box is equivalent to a small wordpad program. Of course, users can perform simple formatting on the input conversation messages in both plain text input boxes and rich text input boxes, such as bold, italic, font, font size, etc.
[0052] Figure 2e A schematic diagram of a conversation translation scenario provided by another embodiment of this specification, such as Figure 2e As shown in the figure, in a scenario, taking collaborative office software on the mobile phone as an example, a user can input a conversation message in voice form through a voice input control in an instant messaging application integrated with the collaborative office software. When the user inputs the conversation message in voice form, the instant messaging application can translate the conversation message in voice form input by the user into the language used by the conversation partner in real time, and display the translated text in the translation text display area. The figure takes English as an example for explanation. Figure 2eIn the example, when the conversation message input by the user is a voice message, the voice message can be first converted into the corresponding input text for display, and the translated text obtained by translating the input text can be displayed simultaneously. As mentioned above, Figure 2e In the text format, the translation text and the input text have the same text format, which can be the default format of the session, or the format pre-configured by the user in the session.
[0053] It can be seen that in this embodiment, when the user inputs the conversation message through a plain text box, a rich text box, a voice input control, etc., the conversation message can be translated in real time, thereby meeting the conversation translation needs in different scenarios.
[0054] In one embodiment, the text format of the text content in each place in the input text is consistent. Figure 2a As shown, the text format of the text content in each place in the input text is consistent, all are 4-point Song font. In another embodiment, the text format of the text content in each place in the input text can be different. Figure 2c As shown in the figure, the text format of the first line of input text is Songti 4, the text format of the second line of input text is Songti 4 bold, the text format of the third line of input text is Songti 4 italic, and the text format of the fourth line of input text is Songti 4 underlined. In both cases, Figure 2a and Figure 2c As shown, through the method in this embodiment, it can be ensured that the second text format of the translated text is the same as the first text format of the input text.
[0055] In one embodiment, the conversation interface has an input area and a translation text display area. The input area has a text display sub-area, the text display sub-area is used to display the input text, and the translation text display area is used to display the translation text. The input area and the translation text display area are arranged side by side in the vertical direction.
[0056] by Figure 2a For example, Figure 2a The figure shows the translation text display area and the input area. The translation text display area and the input area are arranged side by side in the vertical direction. The input area also has a text display sub-area. In the scenario where the user enters text, the text display sub-area is used to display the text entered by the user in real time, and the translation text display area is used to display the translated text in real time.
[0057] by Figure 2e For example, Figure 2eThe figure schematically shows the translation text display area and the input area. The translation text display area and the input area are arranged side by side in the vertical direction. The input area also has a text display sub-area. In the scenario where the user inputs audio data, the text display sub-area is used to display the input text corresponding to the audio data input by the user in real time, and the translation text display area is used to display the translated text in real time.
[0058] In one embodiment, after the translated text is displayed in the translated text display area of the conversation interface, the translated text or the audio data corresponding to the translated text may be sent to the conversation in response to the user's confirmation operation on the translated text. Figure 2a-2e As shown, the user can confirm the translated text by clicking a confirmation key, so that the translated text confirmed by the user or the audio data corresponding to the translated text after the confirmation is sent to the conversation.
[0059] In another embodiment, after the translated text is displayed in the translated text display area of the conversation interface, the translated text may be synchronously processed in response to the user's processing operation on the input text, wherein the processing operation includes at least one of: scrolling operation, text editing operation, format modification operation, text selection operation, and cursor movement operation.
[0060] Specifically, the user can scroll through the input text, and the translated text can be scrolled synchronously. The user can edit the input text, and the translated text can be edited synchronously, and the translation of the input text edited by the user will be reflected in the edited translated text. The user can modify the format of the input text, and the format of the translated text can be modified synchronously, keeping the text format of the input text the same as the text format of the translated text. The user can select the input text, and the corresponding translated text can be selected synchronously. The user can move the cursor on the input text, and the cursor can be moved synchronously in the translated text.
[0061] It can be seen that through this embodiment, the translated text can be processed synchronously when the user processes the input text, so that the user can achieve the effect of modifying the translated text by modifying the original text.
[0062] In this embodiment, in response to the user's confirmation operation on the synchronized translated text, the synchronized translated text or the audio data corresponding to the synchronized translated text can be sent to the session. Figure 3 A flowchart of a method for implementing conversation translation provided by another embodiment of this specification is shown in FIG. Figure 3 As shown, the process includes the following steps:
[0063] Step S302: displaying corresponding input text in an input area of the conversation interface according to an input operation of the user in the conversation interface, where the input text has a first text format;
[0064] Step S304, obtaining a translation text of the input text, the translation text having a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0065] Step S306, displaying the translated text in the translated text display area of the conversation interface;
[0066] Step S308, in response to the user's confirmation operation on the translated text, sending the translated text or the voice data corresponding to the translated text to the conversation;
[0067] Step S310, in response to the user's processing operation on the input text, synchronously processing the translated text;
[0068] Step S312: in response to the user's confirmation operation on the processed translated text, the processed translated text or the voice data corresponding to the processed translated text is sent to the conversation.
[0069] Specifically, after the translated text is displayed, in one case, if the user does not modify the input text, step S308 is executed to receive the user's confirmation operation on the translated text, and the translated text or the voice data corresponding to the translated text is sent to the session. In another case, if the user modifies the input text, steps S310 and S312 are executed to receive the user's processing operation on the input text, and the translated text is processed accordingly, and then the user's confirmation operation on the processed translated text is received, and the translated text confirmed by the user or the voice data corresponding to the translated text after the confirmation is sent to the session.
[0070] In one embodiment, in the above step S104, the translation text of the input text is obtained, specifically:
[0071] (b1) determining the user's session object in the session;
[0072] (b2) obtaining language information of the conversation partner;
[0073] (b3) Obtaining a translated text obtained by translating and formatting the input text according to the language information of the conversation partner.
[0074] In one embodiment, in action (b1), determining the session object of the user in the session is specifically:
[0075] (b11) when the session is a one-on-one chat session, the user's session object in the one-on-one chat session is used as the user's session object;
[0076] (b12) When the session is a group chat session, determining a target message for a preset message response operation performed by the user in the group chat session, and taking the sender of the target message as the user's session object.
[0077] In action (b11), for a single chat session, the user's session object in the single chat session is used as the user's session object. In action (b12), for a group chat session, the target message for the user to perform a preset message response operation in the group chat session is determined, and the sender of the target message is used as the user's session object.
[0078] In one embodiment, the preset message response operation includes: a message reading operation and a message marking operation of marking a message as a message to be replied; determining a target message for the user to perform the preset message response operation in the group chat session, specifically:
[0079] If there is a user's to-be-replied message obtained according to the message marking operation mark in the group chat session, the to-be-replied message is determined as the target message; if there is no user's to-be-replied message obtained according to the message marking operation mark in the group chat session, the user's read message in the group chat session is determined as the target message according to the message reading operation;
[0080] Specifically, after the user performs a preset message response operation on a group chat message in a group chat session, it is determined whether there is a pending reply message of the user marked according to the message marking operation in the group chat session. If so, the pending reply message is determined as the target message. If not, the read messages of the users in the session are determined as the target messages according to the message reading operation.
[0081] In one embodiment, the preset message response operation includes: a message reading operation; determining a target message for the user to perform the preset message response operation in the group chat session, specifically: determining the user's read message in the group chat session as the target message according to the message reading operation. That is, when the preset message response operation includes the message reading operation, the user's read message in the group chat session is determined as the target message.
[0082] In one embodiment, the preset message response operation includes: a message marking operation of marking a message as a message to be replied; determining a target message for the user to perform the preset message response operation in the group chat session, specifically: determining the user's message to be replied marked in the group chat session as the target message according to the message marking operation. That is, when the preset message response operation includes the message marking operation, the message to be replied marked by the user in the group chat session is determined as the target message.
[0083] Considering that a user may have read multiple messages in a group chat session, in the above process, the user's read messages in the group chat session are determined as target messages according to the message reading operation. When there are multiple messages that have been read, the last message that the user has read as determined by the message reading operation is determined as the target message. Thus, if the user has not marked a message to be replied to and has read multiple messages, the last message that has been read can be determined as the target message, so that the sender of the target message can be further used as the user's session object in the group chat session.
[0084] It can be seen that in this embodiment, in a single chat session, the user's session object can be determined. In a group chat session, the session object can be determined according to the user's operation. The sender corresponding to the message to be replied marked by the user is most likely the session object to which the user replies. If the user does not mark the message to be replied, the sender corresponding to the message read by the user is most likely the session object to which the user replies. The session object most likely to be replied by the user is used as the user's session object in the group chat session, thereby accurately determining the user's session object in the group chat scenario.
[0085] In the above action (b2), the language information of the conversation object is obtained. In one embodiment, the action is specifically:
[0086] (b21) when the conversation is a one-on-one chat conversation, obtaining the main language information of the conversation object as the language information of the conversation object, or using the language information of the message that meets the preset conditions sent by the conversation object in the one-on-one chat conversation as the language information corresponding to the conversation;
[0087] (b22) When the conversation is a group chat conversation, obtaining the main language information of the conversation object as the language information of the conversation object, or determining the target message sent by the conversation object in the group chat conversation and for which the user performs a preset message response operation, and using the language information of the target message as the language information of the conversation object.
[0088] In a one-on-one chat session, in one case, after determining the user's conversation partner, the main language information of the conversation partner can be obtained as the language information of the conversation partner. The language of the message sent by the conversation partner is identified using a machine learning model. For example, the conversation message sent by the conversation partner in the conversation of the instant messaging application is input into a pre-trained machine learning model, and the machine learning model outputs the language information of the conversation message. The language information output by the machine learning model is used as the language label of the conversation message. In this way, the language labels of the conversation messages sent by the conversation partner in the recent period (such as 3 months) can be counted to determine the main language information of the conversation partner. Of course, if the conversation partner sets a label for the main language information for itself, the label can be directly obtained to determine the main language information of the conversation partner. Furthermore, the main language information of the conversation partner is used as the language information of the conversation partner.
[0089] In a one-on-one chat session, in another case, the language information of the message that meets the preset conditions and is sent by the conversation object in the one-on-one chat session is used as the language information of the conversation object. Among them, the message that meets the preset conditions includes one or more of the following: the last message read by the above user, and the message to be replied marked by the above user. Specifically, in the one-on-one chat session between the above user and the conversation object, the conversation object sends a conversation message, and the language information of the last message read by the above user in the sent conversation message is used as the language information of the conversation object, or the language information of the message to be replied marked by the above user in the sent conversation message is used as the language information of the conversation object. When there are both the message read by the above user and the message to be replied marked by the above user in the sent conversation message, the language information of the last message read by the above user can be obtained, and the language information of the message to be replied marked by the above user can be obtained. When the two language information are the same, the same language information is used as the language information of the conversation object. When the two language information are different, the language information of the message to be replied marked by the above user is taken as the language information of the conversation object.
[0090] In a group chat session, the main language information of the conversation object can be obtained as the language information of the conversation object in the same manner as described above. Alternatively, the target message sent by the conversation object in the group chat session and to which the user performs a preset message response operation is determined. The process of determining the target message is the same as the process of determining the target message in the previous action (b12). Based on the previous process of determining the target message, it can be known that the target message is sent by the conversation object. The language information of the target message is used as the language information of the conversation object. The language information of the target message can be identified by a machine learning model.
[0091] It can be seen that through actions (b21) and (b22), the language information of the conversation object can be obtained in different conversation scenarios.
[0092] In one embodiment, in action (b3), the input text is translated and formatted according to the language information of the conversation object to obtain the translated text, which can be completed by a pre-trained machine learning model. When training the machine learning model, the formatted text data and the translation with the same format as the text data can be used as training data, and the parameters in the model are trained by the training data. The trained model has the ability to translate text and keep the original text and the translation format the same.
[0093] In another embodiment, in action (b3), the input text is translated and formatted according to the language information of the conversation object to obtain a translated text. Specifically, the input text is translated through a pre-trained machine learning model, and the text output by the machine learning model is formatted according to the format information of the first text format of the input text to obtain a translated text. Since the translated text is obtained by formatting the text output by the machine learning model according to the format information of the first text format, the second text format of the translated text is the same as the first text format of the input text.
[0094] In summary, through the above method for realizing conversation translation, the input text of the user in the conversation can be translated in real time to obtain the translated text, and the text format of the translated text can be kept consistent with that of the input text. With the help of the format synchronization capability between the translated text and the input text, the user's expression intention can be better retained in the translated text, thereby improving the communication efficiency between users in cross-language communication scenarios and improving the users' collaborative office efficiency.
[0095] Figure 4 A schematic diagram of a structure of a device for implementing conversation translation provided in an embodiment of this specification is shown in FIG. Figure 4 As shown, the device comprises:
[0096] A first display unit 41, configured to display corresponding input text in an input area of the conversation interface according to an input operation of a user in the conversation interface, wherein the input text has a first text format;
[0097] A text acquisition unit 42, configured to acquire a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0098] The second display unit 43 is configured to display the translated text in the translated text display area of the conversation interface.
[0099] Optionally, the text acquisition unit 42 is specifically used for:
[0100] determining a session object of the user in the session;
[0101] Obtaining language information of the conversation object;
[0102] A translated text is obtained by translating and formatting the input text according to the language information of the conversation object.
[0103] Optionally, the method further comprises a processing unit, configured to:
[0104] After the translated text is displayed in the translated text display area of the conversation interface, the translated text is synchronously processed in response to the user's processing operation on the input text.
[0105] Optionally, the device further includes a sending unit, configured to:
[0106] After the translated text is displayed in the translated text display area of the conversation interface, in response to the user's confirmation operation on the translated text, the translated text or audio data corresponding to the translated text is sent to the conversation.
[0107] Optionally, the first display unit 41 is specifically used for:
[0108] According to a text input operation of a user in a conversation interface, obtaining the user's input text and displaying it in an input area of the conversation interface;
[0109] or,
[0110] According to the audio input operation of the user in the conversation interface, the audio data input by the user is obtained, the audio data is converted into text to obtain input text, and the input text is displayed in the input area of the conversation interface.
[0111] Optionally, a format setting unit is further included, for:
[0112] After converting the audio data into text to obtain input text, the first text format of the input text is set to be a default format of the session, or a format pre-configured by the user in the session.
[0113] Optionally, the text acquisition unit 42 is further specifically configured to:
[0114] When the session is a single chat session, taking the session object of the user in the single chat session as the session object of the user;
[0115] When the session is a group chat session, a target message for the user to perform a preset message response operation in the group chat session is determined, and a sender of the target message is used as a session object of the user.
[0116] Optionally, the preset message response operation includes: a message reading operation and a message marking operation of marking a message as a message to be replied; the text acquisition unit 42 is further specifically used to: if there is a message to be replied of the user obtained according to the message marking operation mark in the group chat session, then determine the message to be replied as the target message; if there is no message to be replied of the user obtained according to the message marking operation mark in the group chat session, then determine the read message of the user in the group chat session as the target message according to the message reading operation;
[0117] or,
[0118] The preset message response operation includes: a message reading operation; the text acquisition unit 42 is further specifically used to: determine the user's read message in the group chat session as a target message according to the message reading operation;
[0119] or,
[0120] The preset message response operation includes: a message marking operation of marking a message as a message to be replied; the text acquisition unit 42 is also specifically used to: determine the user's message to be replied marked in the group chat session as a target message according to the message marking operation.
[0121] Optionally, the text acquisition unit 42 is further specifically configured to:
[0122] When the number of the read messages is multiple, the last message read by the user determined according to the message reading operation is determined as the target message.
[0123] Optionally, the text acquisition unit 42 is further specifically configured to:
[0124] When the session is a single chat session, obtaining the main language information of the session object as the language information of the session object, or using the language information of the message meeting the preset condition sent by the session object in the single chat session as the language information of the session object;
[0125] When the conversation is a group chat conversation, the main language information of the conversation object is obtained as the language information of the conversation object, or, a target message sent by the conversation object in the group chat conversation and for which the user performs a preset message response operation is determined, and the language information of the target message is used as the language information of the conversation object.
[0126] Optionally, the message that meets the preset condition includes one or more of the following:
[0127] The last message read by the user;
[0128] The message marked by the user as waiting for reply.
[0129] It should be noted that the device for implementing conversation translation in this embodiment can implement each process of the aforementioned method embodiment for implementing conversation translation and achieve the same effects and functions, which will not be repeated here.
[0130] An embodiment of the present specification also provides an electronic device, Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification, such as Figure 5As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and one or more applications or data may be stored in the memory 802. Among them, the memory 802 may be a temporary storage or a permanent storage. The application stored in the memory 802 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 801 can be configured to communicate with the memory 802 to execute a series of computer executable instructions in the memory 802 on the electronic device. The electronic device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input or output interfaces 805, one or more keyboards 806, etc.
[0131] In a specific embodiment, the electronic device includes a processor; and a memory configured to store computer executable instructions, wherein when the computer executable instructions are executed, the processor implements the following process:
[0132] According to an input operation of a user in a conversation interface, displaying a corresponding input text in an input area of the conversation interface, wherein the input text has a first text format;
[0133] Obtaining a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0134] The translated text is displayed in a translated text display area of the conversation interface.
[0135] It should be noted that the electronic device in this embodiment can implement the various processes of the aforementioned method embodiment for realizing conversation translation and achieve the same effects and functions, which will not be repeated here.
[0136] Another embodiment of the present specification further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0137] According to an input operation of a user in a conversation interface, displaying a corresponding input text in an input area of the conversation interface, wherein the input text has a first text format;
[0138] Obtaining a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text;
[0139] The translated text is displayed in a translated text display area of the conversation interface.
[0140] It should be noted that the storage medium in this embodiment can implement each process of the aforementioned method embodiment for implementing conversation translation and achieve the same effects and functions, which will not be repeated here.
[0141] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0142] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0143] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0144] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0145] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0146] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0148] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0150] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0151] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0152] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0153] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A method for implementing conversation translation, characterized in that: include: According to an input operation of the user in the conversation interface, displaying corresponding input text in an input area of the conversation interface, the input text having a first text format, which is a text format that the user customizes for the input text when editing the input text; Obtaining a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text; The translated text is displayed in a translated text display area of the conversation interface.
2. The method according to claim 1, characterized in that The step of obtaining the translated text of the input text comprises: determining a session object of the user in the session; Obtaining language information of the conversation object; A translated text is obtained by translating and formatting the input text according to the language information of the conversation object.
3. The method according to claim 1, characterized in that After displaying the translated text in the translated text display area of the conversation interface, the method further includes: In response to the user's processing operation on the input text, the translation text is synchronously processed.
4. The method according to claim 1, characterized in that: After displaying the translated text in the translated text display area of the conversation interface, the method further includes: In response to the user's confirmation operation on the translated text, the translated text or audio data corresponding to the translated text is sent to the conversation.
5. The method according to claim 1, characterized in that The step of displaying corresponding input text in an input area of the conversation interface according to an input operation of the user in the conversation interface includes: According to a text input operation of a user in a conversation interface, obtaining the user's input text and displaying it in an input area of the conversation interface; or, According to the audio input operation of the user in the conversation interface, the audio data input by the user is obtained, the audio data is converted into text to obtain input text, and the input text is displayed in the input area of the conversation interface.
6. The method according to claim 5, characterized in that After converting the audio data into text to obtain input text, the method further includes: The first text format of the input text is set to a default format of the session, or to a format pre-configured by the user in the session.
7. The method according to claim 2, characterized in that The determining the session object of the user in the session includes: When the session is a single chat session, taking the session object of the user in the single chat session as the session object of the user; When the session is a group chat session, a target message for the user to perform a preset message response operation in the group chat session is determined, and a sender of the target message is used as a session object of the user.
8. The method according to claim 7, characterized in that The preset message response operation includes: a message reading operation and a message marking operation of marking a message as a message to be replied; the determining the target message for the user to perform the preset message response operation in the group chat session includes: if there is a message to be replied of the user obtained by the message marking operation mark in the group chat session, then determining the message to be replied as the target message; if there is no message to be replied of the user obtained by the message marking operation mark in the group chat session, then determining the read message of the user in the group chat session as the target message according to the message reading operation; or, The preset message response operation includes: a message reading operation; the determining the target message for the user to perform the preset message response operation in the group chat session includes: determining the user's read message in the group chat session as the target message according to the message reading operation; or, The preset message response operation includes: a message marking operation of marking a message as a message to be replied; the determining of the target message of the user performing the preset message response operation in the group chat session includes: determining the user's message to be replied marked in the group chat session as the target message according to the message marking operation.
9. The method according to claim 8, characterized in that The determining, according to the message reading operation, the read message of the user in the group chat session as the target message includes: When the number of the read messages is multiple, the last message read by the user determined according to the message reading operation is determined as the target message.
10. The method according to claim 2, characterized in that The acquiring the language information of the conversation object includes: When the session is a single chat session, obtaining the main language information of the session object as the language information of the session object, or using the language information of the message meeting the preset condition sent by the session object in the single chat session as the language information of the session object; When the conversation is a group chat conversation, the main language information of the conversation object is obtained as the language information of the conversation object, or, a target message sent by the conversation object in the group chat conversation and for which the user performs a preset message response operation is determined, and the language information of the target message is used as the language information of the conversation object.
11. The method according to claim 10, characterized in that The message that meets the preset conditions includes one or more of the following: the last message read by the user; The message marked by the user as waiting for reply.
12. A device for implementing conversation translation, characterized in that: include: A first display unit, configured to display corresponding input text in an input area of the conversation interface according to an input operation of a user in the conversation interface, wherein the input text has a first text format, which is a text format that the user customizes for the input text when editing the input text; A text acquisition unit, used for acquiring a translation text of the input text, wherein the translation text has a second text format; the second text format of the translation text is consistent with the first text format of the input text; The second display unit is configured to display the translated text in the translated text display area of the conversation interface.
13. An electronic device, characterized in that: include: processor; as well as, A memory configured to store computer executable instructions, which, when executed, cause the processor to implement the steps of the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the method described in any one of claims 1 to 11.
Citation Information
Patent Citations
Information instant translation method, device and system
CN110119514A
Message processing method and device and terminal device
CN110619126A
Cited By
Method, device, and storage medium for translating and displaying messages
US12608567B2