Translation system and methods for text translation, downloading, quality checking and editing.
By introducing an interactive mechanism between front-end devices and back-end servers in the translation system, users can upload original text on the translation interface of the front-end device, and the back-end server translates and returns the translation, solving the problem of huge time-consuming translation process in the existing technology. , realizes quick translation of the entire text.
Patent Information
- Application Number
- CN202011641981.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2040-12-31
AI Technical Summary
When translating texts, existing translation software and websites require users to enter word by word, sentence by sentence, which makes the translation process very time-consuming and cannot achieve quick translation of the entire text.
Provide a translation system, including front-end devices and back-end servers. Users upload original text through the translation interface of the front-end device, and the back-end server translates, and transmits the translation back to the front-end device to display, realizing quick translation without word-by-word input. .
It greatly reduces translation time, realizes quick translation of text, and improves translation efficiency.
Smart Images

Figure CN114692655B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine translation, and in particular to a translation system and a text translation, downloading, quality checking and editing method. Background Art
[0002] In daily work, life and study, people often need to translate foreign texts into Chinese, or translate Chinese texts into foreign languages. To meet people's translation needs, there are now a variety of translation software and translation websites on the market.
[0003] When using translation software and translation websites for translation, users are required to enter the text to be translated into the translation dialog box word by word, and then click the translate button to get the translation of a word or a sentence.
[0004] In actual applications, users usually need to translate the entire text. If the translation is still done word by word, it will inevitably lead to a huge time-consuming translation process. Therefore, how to quickly translate the entire text has become an urgent problem to be solved. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a translation system and a text translation, download, quality inspection and editing method to achieve fast translation of text. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a translation system, the translation system comprising: a front-end device and a back-end server, wherein the front-end device is provided with a translation interface;
[0007] The front-end device is used to transmit the original text to the back-end server after receiving the original text uploaded by the user through the translation interface;
[0008] The back-end server is used to obtain the original text; translate the original text to obtain the translation of the original text; and transmit the translation to the front-end device so that the front-end device displays the translation on the translation interface.
[0009] In a second aspect, an embodiment of the present invention provides a text translation method, the method comprising:
[0010] Obtaining the original text uploaded by the user through the translation interface provided by the front-end device;
[0011] Translate the original text to obtain a translation of the original text;
[0012] The translation is transmitted to the front-end device so that the front-end device displays the translation on the translation interface.
[0013] In a third aspect, an embodiment of the present invention provides a text downloading method, the method comprising:
[0014] Receiving a download instruction initiated by a user via a translation interface provided by a front-end device;
[0015] Get the translation corresponding to the download instruction;
[0016] Identifying a download mode selected by a user via a translation interface contained in a download instruction, wherein the download mode includes a translation text download and a comparison text download;
[0017] If the download mode selected by the user is the translation text download, the translation text is generated according to the specified text format based on the translation text, and the translation text is sent to the front-end device for the user to download;
[0018] If the download mode selected by the user is comparison text download, based on the preset text content division strategy, the translation of each part of the original text of the translation is added after the parts of the content divided, and after the addition is completed, the comparison text is generated according to the specified text format; the comparison text is sent to the front-end device for the user to download.
[0019] In a fourth aspect, an embodiment of the present invention provides a quality inspection method, the method comprising:
[0020] Receiving a quality inspection instruction initiated by a user via a translation interface provided by a front-end device;
[0021] From the translations to be checked, multiple sentences are selected in order of translation scores from low to high;
[0022] Instruct the front-end device to highlight multiple sentences to prompt the user to focus on checking the multiple sentences.
[0023] In a fifth aspect, an embodiment of the present invention provides a text translation method, the method comprising:
[0024] Obtaining the original text and custom terminology library uploaded by the user through the translation interface provided by the front-end device;
[0025] Identify whether the original text contains text content in the custom term base;
[0026] If it exists, the corresponding text content in the original text is translated according to the translation rules in the custom term base, and the other text content in the original text is translated according to the general translation rules to obtain the translation of the original text.
[0027] In a sixth aspect, an embodiment of the present invention provides a text translation and editing method, the method comprising:
[0028] Obtaining the original text uploaded by the user through the translation interface provided by the front-end device, and translating the original text to obtain a translation of the original text displayed on the translation interface;
[0029] When it is identified that the user selects the translation editing mode via the translation interface, the translation is set to an editing state so that the user can edit the content in the translation.
[0030] In a seventh aspect, an embodiment of the present invention provides a text translation device, the device comprising:
[0031] An acquisition module, used to acquire the original text uploaded by the user via the translation interface provided by the front-end device;
[0032] A translation module is used to translate the original text to obtain a translation of the original text;
[0033] The transmission module is used to transmit the translation to the front-end device so that the front-end device displays the translation on the translation interface.
[0034] In an eighth aspect, an embodiment of the present invention provides a text downloading device, the device comprising:
[0035] A receiving module, used for receiving a download instruction initiated by a user via a translation interface provided by a front-end device;
[0036] The acquisition module is used to obtain the translation corresponding to the download instruction;
[0037] An identification module, used for identifying a download mode selected by a user via a translation interface contained in the download instruction, wherein the download mode includes a translation text download and a comparison text download;
[0038] A processing module is used to generate a translated text according to the specified text format based on the translation if the download mode selected by the user is translated text download, and send the translated text to the front-end device for the user to download; if the download mode selected by the user is reference text download, based on a preset text content division strategy, add the translation of each part of the content after the original text of the translated text is divided, and after the addition is completed, generate a reference text according to the specified text format; send the reference text to the front-end device for the user to download.
[0039] In a ninth aspect, an embodiment of the present invention provides a quality inspection device, the device comprising:
[0040] A receiving module, used to receive a quality inspection instruction initiated by a user via a translation interface provided by a front-end device;
[0041] A selection module, for selecting a plurality of sentences from the translation to be checked in order of translation scores of the sentences from low to high;
[0042] The instruction module is used to instruct the front-end device to highlight multiple sentences to prompt the user to focus on checking the multiple sentences.
[0043] In a tenth aspect, an embodiment of the present invention provides a text translation device, the device comprising:
[0044] An acquisition module is used to acquire the original text and the custom terminology library uploaded by the user through the translation interface provided by the front-end device;
[0045] Recognition module, used to identify whether the original text contains text content in the custom term base;
[0046] The translation module is used to translate the corresponding text content in the original text according to the translation rules in the custom term base if it exists, and translate other text content in the original text according to the general translation rules to obtain the translation of the original text.
[0047] In an eleventh aspect, an embodiment of the present invention provides a text translation and editing device, the device comprising:
[0048] The acquisition module is used to acquire the original text uploaded by the user through the translation interface provided by the front-end device, and translate the original text to obtain the translation of the original text displayed on the translation interface;
[0049] The setting module is used to set the translation to an editing state when recognizing that the user selects the translation editing mode through the translation interface, so that the user can edit the content in the translation.
[0050] In the twelfth aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement: the method provided in the second aspect of the embodiment of the present invention, or the method provided in the third aspect of the embodiment of the present invention, or the method provided in the fourth aspect of the embodiment of the present invention, or the method provided in the fifth aspect of the embodiment of the present invention, or the method provided in the sixth aspect of the embodiment of the present invention.
[0051] In the thirteenth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it implements: the method provided in the second aspect of the embodiment of the present invention, or the method provided in the third aspect of the embodiment of the present invention, or the method provided in the fourth aspect of the embodiment of the present invention, or the method provided in the fifth aspect of the embodiment of the present invention, or the method provided in the sixth aspect of the embodiment of the present invention.
[0052] In the fourteenth aspect, the embodiment of the present invention also provides a computer program product comprising instructions, which, when run on a computer, enables the computer to execute: the method provided in the second aspect of the embodiment of the present invention, or the method provided in the third aspect of the embodiment of the present invention, or the method provided in the fourth aspect of the embodiment of the present invention, or the method provided in the fifth aspect of the embodiment of the present invention, or the method provided in the sixth aspect of the embodiment of the present invention.
[0053] Beneficial effects of the embodiments of the present invention: In the solution provided by the embodiments of the present invention, the translation system includes a front-end device and a back-end server. The front-end device provides a translation interface. After receiving the original text uploaded by the user through the translation interface, the front-end device transmits the original text to the back-end server, which translates the original text to obtain the translation of the original text, and then transmits the obtained translation to the front-end device, which displays the translation on the translation interface. It can be seen that the user only needs to upload the original text on the translation interface provided by the front-end device, the front-end device and the back-end server interact, the back-end server translates the original text, and displays the translation of the original text on the front-end device, without the user having to input word by word, which greatly reduces the time consumption of translation, thereby realizing the quick translation of text. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A schematic diagram of the structure of a translation system according to an embodiment of the present invention;
[0056] Figure 2 A flowchart of a text translation method according to an embodiment of the present invention;
[0057] Figure 3 A flowchart of a text translation method according to another embodiment of the present invention;
[0058] Figure 4 A flowchart of a text translation method according to another embodiment of the present invention;
[0059] Figure 5 A flowchart of a text translation method according to another embodiment of the present invention;
[0060] Figure 6 A flowchart of a text translation method according to another embodiment of the present invention;
[0061] Figure 7 A flowchart of a text translation method according to another embodiment of the present invention;
[0062] Figure 8 A schematic diagram of the overall process of text translation by the translation system according to an embodiment of the present invention;
[0063] Fig. 9 A schematic diagram of a translation interface according to an embodiment of the present invention;
[0064] Fig.10 A schematic diagram of options for editing a translation in a translation interface of an embodiment of the present invention;
[0065] Fig.11 A schematic diagram of download options according to an embodiment of the present invention;
[0066] Fig.12 A schematic diagram of the translation process of an original document according to an embodiment of the present invention;
[0067] Fig.13 A schematic diagram of the translation system architecture of an embodiment of the present invention;
[0068] Fig.14 A flowchart of a text downloading method according to an embodiment of the present invention;
[0069] Fig.15 A flow chart of a quality inspection method according to an embodiment of the present invention;
[0070] Fig.16 A flowchart of another text translation method according to an embodiment of the present invention;
[0071] Fig.17 A flowchart of a text translation and editing method according to an embodiment of the present invention;
[0072] Fig.18 A structural schematic diagram of a text translation device according to an embodiment of the present invention;
[0073] Fig.19 A schematic diagram of the structure of a text downloading device according to an embodiment of the present invention;
[0074] Fig. 20 is a schematic structural diagram of a quality inspection device according to an embodiment of the present invention;
[0075] Fig.21 A schematic diagram of the structure of another text translation device according to an embodiment of the present invention;
[0076] Fig. 22 A schematic diagram of the structure of a text translation and editing device according to an embodiment of the present invention;
[0077] Fig.23Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0079] In order to realize quick translation of text, the embodiment of the present invention provides a translation system and a text translation, downloading, quality checking and editing method.
[0080] like Figure 1 As shown, the translation system provided by the embodiment of the present invention includes a client at a front-end device 110 and a server at a back-end server 120. The front-end device 110 can be a mobile phone, a personal computer, a portable computer, a tablet computer, etc. The front-end device 110 provides a translation interface. The translation interface can be a user interaction interface provided by a translation APP (application) installed on the front-end device, or it can be a web page interface of a translation website opened by a user on the front-end device, or it can be a user interaction interface provided by an application software installed at the front-end device. For the convenience of discussion, the translation interface is displayed to the user through the client of the above three display methods.
[0081] The front-end device 110 can use VUE (a framework for building user interfaces) combined with Element UI (a user interface component) to implement functional operations and displays, and the back-end server 120 can be composed of Springboot (a software development framework), Mysql (a relational database management system), Redis (a remote dictionary service), Jodconvert (a file conversion tool), MongoDB (a distributed document storage database), etc. The front-end device 110 and the back-end server 120 are provided with a translation interface, such as an API interface (Application Programming Interface). Generally, it can be an HTTP (HyperText Transfer Protocol) interface, and data interaction is performed through the translation interface.
[0082] After receiving the original text uploaded by the user through the translation interface, the front-end device 110 transmits the original text to the back-end server 120. Generally, the original text uploaded by the user can be a document in a certain format, such as a document in txt, doc / docx, xls / xlsx, ppt / pptx, or pdf format. After obtaining the original text, the back-end server 120 translates the original text to obtain a translation of the original text, and then transmits the translation to the front-end device 110 so that the front-end device 110 displays the translation on the translation interface.
[0083] By applying the embodiment of the present invention, after receiving the original text uploaded by the user through the translation interface, the front-end device transmits the original text to the back-end server, which translates the original text to obtain the translation of the original text, and then transmits the obtained translation to the front-end device, which displays the translation on the translation interface. It can be seen that the user only needs to upload the original text on the translation interface provided by the front-end device, the front-end device and the back-end server interact, the back-end server translates the original text, and displays the translation of the original text on the front-end device, without the user having to input word by word, which greatly reduces the time consumption of translation, thereby realizing the quick translation of text.
[0084] In a specific embodiment of the present invention, the above-mentioned translation system includes the following modules: language automatic identification module, machine translation module, document classification module, post-editing module, and format conversion module. The language automatic translation module is used to identify the language type of the original text; the machine translation module is used to translate the various parts of the original text; the document classification module is used to identify the field type of the original text and generate a language type identifier; the post-editing module is used to provide users with the function of editing the translation; the format conversion module is used to identify the format of the original text, convert the format of the original text into a format that can be recognized by the machine translation module, and generate a language type identifier.
[0085] An embodiment of the present invention provides a text translation method, such as Figure 2 As shown, the back-end server used in the above translation system includes the following steps. The back-end server can be a server. A client is installed at the front-end device, and the client can be a web browser, an APP application, or a PC application.
[0086] S201, obtaining the original text from the client.
[0087] Specifically, the method for the server to obtain the original text may be to obtain the original text uploaded by the user through the translation interface provided by the front-end device; it may be to obtain the original text uploaded by the user through the translation interface provided by the front-end device; or receive the original text uploaded by the user through the translation interface provided by the front-end device from the front-end device; or receive the original text uploaded by the user through the translation interface provided by the front-end device; or open an API interface to receive the original text sent by the client at the front-end device.
[0088] Specifically, the original text uploaded by the user through the front-end device is encrypted and then sent to the back-end server. After receiving the encrypted original text, the back-end server performs identity authentication to determine whether it is a legitimate translation requirement and decrypts the original text. The identity authentication can be the authentication of the user's identity, the authentication of whether the encrypted file has been tampered with, or the authentication method of determining the source of the encrypted file.
[0089] S202: Translate the original text to obtain a translation of the original text.
[0090] Specifically, the original text is sent to the language automatic identification module for language identification, the document classification module for document classification, and the format conversion module for format identification and format conversion. Then, the original text after format conversion, as well as the document type identifier and the language type identifier are sent to the machine translation module to machine translate the original text to obtain the translation of the original text.
[0091] S203, transmitting the translation to the client, so that the translation is displayed on the translation interface of the front-end device.
[0092] Specifically, the backend server transmits the translation to the client through the API interface, and the client displays the translation on the display at the front-end device through the translation interface.
[0093] By applying the embodiment of the present invention, after obtaining the original text uploaded by the user through the translation interface provided by the front-end device, the back-end server translates the original text to obtain the translation of the original text, and then transmits the obtained translation to the front-end device, which is displayed on the translation interface by the front-end device. It can be seen that the user only needs to upload the original text on the translation interface provided by the front-end device, the front-end device and the back-end server interact, the back-end server translates the original text, and displays the translation of the original text on the front-end device, without the need for the user to input word by word, which greatly reduces the time consumption of translation, thereby realizing the quick translation of the text. The present invention realizes document translation through the machine translation technology of the machine translation module, with fast translation speed and high accuracy. Document translation technology is different from traditional dictionary translation technology. Dictionary translation technology does not consider the relationship between sentences in the entire document, but translates word by word and sentence by sentence, and cannot solve the relevance of sentences in the context, while document translation technology can solve the relationship between sentences and improve the accuracy of translation.
[0094] The client provides a translation interface, which has a selection box for uploading text. When the user clicks the selection box, a text open dialog box will pop up, in which the original text to be translated can be selected to upload the original text. Of course, the user can also directly drag and drop the original text to be translated into the selection box area to upload the original text. The back-end server can receive the original text through an interface call.
[0095] Specifically, after the user clicks the upload button or the mouse dragging action is completed, the client of the front-end device receives the upload instruction or the mouse dragging action, and the client obtains the address path of the document, determines whether it is a valid instruction, whether it is a recognizable original text, obtains the original text under the address path, and then encrypts the original text and sends it to the server. The server decrypts and converts the document. During the format conversion process, the text part is separated from the original text, such as the text in the table, the text in the picture, the text in the mind map, the horizontal and vertical text, the formula, etc., to obtain the text part in the original text. For format conversion, the client can first perform format conversion to obtain the original text in a format that the translation system can recognize, and then encrypt the original text in the recognizable format and send it to the server. The server directly obtains the original text in a recognizable format.
[0096] Specifically, after the user clicks the upload button or completes a drag-and-drop action such as mouse drag, touch drag, or gesture drag, the client of the front-end device receives the upload instruction or drag-and-drop action, obtains the address path information of the original text, determines whether it is a valid instruction, obtains the format information of the original text, determines whether it is a recognizable text, obtains the size of the original text and the number of characters it contains, determines whether it can be translated, and outputs a prompt message to prompt the user to re-upload the original text if any judgment condition is not met. If all judgment conditions are met, the original text under the address path is obtained, and then the original text is encrypted and sent to the back-end server. The back-end server decrypts the original text and separates various parts of the content from the original text, such as the text content of each paragraph, the text content of the table, the text content of the picture, the text content of the mind map, and the formula.
[0097] After obtaining the original text, the back-end server translates the original text. The way in which the back-end server translates the original text can be specifically: input each sentence in the original text into a pre-trained machine translation model, and the machine translation model outputs the translation of each sentence. Among them, the machine translation model can be a deep learning model, and the way to train it is based on a large number of corpus samples, input the corpus sample into a pre-selected first network model, compare the output of the first network model with the nominal translation of the corpus sample, and obtain a loss value. If the loss value is greater than or equal to a preset threshold, adjust the parameters of the first network model, re-input a corpus sample, until the loss value obtained is less than the preset threshold, it can be determined that the model training is completed, and the current first network model is the machine translation model. Among them, the corpus sample can be a sentence, a character, a word, a paragraph or an article. The nominal translation of the corpus sample refers to the standard translation of the set corpus sample. The first network model is any pre-selected deep learning model that can realize the translation function.
[0098] In the practical application of the embodiments of the present invention, since the output is the translation of the entire text, semantic association needs to be performed during translation, that is, when using the machine translation model for translation, the previously translated sentence needs to be input as a reference, and the translation of this sentence needs to refer to the previously translated sentence, that is, context translation semantic association, to ensure that the translation of the same words and sentences in a text is consistent, and to maintain the coherence and coherence between sentences. Machine translation model, hereinafter referred to as translation model.
[0099] In one implementation of the embodiment of the present invention, the first network model may include a first encoder, a second encoder and a decoder. The first encoder includes an input port and an output port, wherein, when the translation model is trained, the input port is used to input the target object, and when the translation model performs sentence translation, the input port is used to input the target object or a specified object; the output port is used to output the first encoding vector obtained by encoding the target object or the specified object. The second encoder includes two input ports and one output port, wherein, when the translation model is trained, the first input port in the second encoder is used to input the training sentence, and when the translation model performs sentence translation, the first input port in the second encoder is used to input the sentence to be translated; the second input port in the second encoder is used to input the first encoding vector; the output port is used to output the second encoding vector. The decoder also includes two input ports and one output port, wherein, the first input port in the decoder is used to input the target sentence, the second input port in the decoder is used to input the second encoding vector, and the output port is used to output the encoding vector.
[0100] The process of training the first network model of the above structure mainly includes the following steps: the first step is to receive training samples, wherein the training samples include corpus samples, nominal translations corresponding to the corpus samples, and target objects corresponding to the corpus samples, and the target objects include target prefixes and / or target suffixes; the second step is to input the target objects into the first encoder for encoding to obtain a first encoding vector; the third step is to input the corpus sample and the first encoding vector into the second encoder for encoding to obtain a second encoding vector; the fourth step is to input the nominal translation and the second encoding vector into the decoder for decoding to obtain a decoding vector, and calculate the loss value according to the decoding vector; the fifth step is to adjust the model parameters of the first network model according to the loss value, and continue to train the first network model until the training stop condition is reached, and then determine that the current first network model is a translation model.
[0101] Among them, the first encoder includes a first embedding layer and x object encoding layers, x is a positive integer greater than or equal to 1, and specifically, the first embedding layer, the first object encoding layer to the x-th object encoding layer are connected in sequence. Therefore, the specific process of inputting the target object into the first encoder for encoding processing to obtain the first encoding vector can be: inputting the target object into the first embedding layer for embedding processing to obtain the target object vector; inputting the target object vector into the first object encoding layer for encoding processing to obtain the first object encoding vector; inputting the first object encoding vector into the second object encoding layer for encoding processing to obtain the second object encoding vector; until the x-1th encoding vector is input into the x-th object encoding layer for encoding processing to obtain the first encoding vector. Specifically, embedding processing refers to the process of representing an object with a low-dimensional vector, for example, using a vector to represent a word, or an object, etc. The property of the embedded vector is that objects corresponding to vectors with similar distances have similar meanings. The characteristics of embedding that can encode objects with low-dimensional vectors and retain their meanings are very suitable for deep learning.
[0102] The second encoder includes a second embedding layer and y sentence encoding layers, y is a positive integer greater than or equal to 1, and specifically, the second embedding layer, the first sentence encoding layer to the y-th sentence encoding layer are sequentially connected. Therefore, the specific process of inputting the corpus sample and the first encoding vector into the second encoder for encoding processing to obtain the second encoding vector can be: inputting the corpus sample into the second embedding layer for embedding processing to obtain the training sentence vector, inputting the training sentence vector and the first encoding vector into the first sentence encoding layer for encoding processing to obtain the first sentence encoding vector; inputting the first sentence vector into the second sentence encoding layer for encoding processing to obtain the second sentence encoding vector; until the y-1-th encoding vector is input into the y-th sentence encoding layer for encoding processing to obtain the second encoding vector.
[0103] The decoder includes a third embedding layer and z decoding layers, where z is a positive integer greater than or equal to 1. Specifically, the third embedding layer, the first decoding layer to the z-th decoding layer are connected in sequence. Therefore, the specific process of inputting the nominal translation and the second encoding vector into the decoder for decoding processing to obtain the decoding vector can be: inputting the nominal translation into the third embedding layer for embedding processing to obtain the nominal translation vector, inputting the nominal translation vector and the second encoding vector into the first decoding layer for decoding processing to obtain the first decoding vector; inputting the first decoding vector into the second decoding layer for decoding processing to obtain the second decoding vector; until the z-1-th decoding vector is input into the z-th decoding layer for decoding processing to obtain the decoding vector.
[0104] The specific method of calculating the loss value based on the decoding vector is: compare the decoding vector with the preset standard vector to obtain the loss value of the decoding vector. When calculating the loss value of the decoding vector, the standard vector is introduced to compare with the obtained decoding vector to calculate the loss value, instead of directly comparing the decoding vector with the nominal translation vector to calculate the loss value. This avoids overfitting when directly comparing the decoding vector with the nominal translation vector to calculate the loss value, optimizes the performance of the translation model in other sentence translations, and makes the translation effect more natural and smooth.
[0105] When adjusting the model parameters of the first network model, it is necessary to adjust the model parameters of the first network model according to the loss value. The specific implementation process is: back-propagating the loss value to sequentially update the decoding parameters of the decoder, the encoding parameters of the second encoder, and the encoding parameters of the first encoder.
[0106] During the training process, a target value can be set in advance. When the loss value is lower than the preset target value, it means that the model has reached the translation standard or a certain translation level, that is, the training stop condition has been reached.
[0107] Through the above-mentioned improved translation model, a first encoder specifically used for encoding the target object is added to the translation model, and the auxiliary translation model can better translate the results with specified prefixes and / or suffixes, and ensure the fluency of the translation results without losing the specified prefixes and / or suffixes in the translation model, making the translation results more natural.
[0108] After the translation model is obtained through training in the above manner, the above translation model can be used for text translation. The specific translation process is: extract the sentence to be translated and the specified object from the original text, where the object includes a prefix and / or a suffix; input the object into the first encoder of the translation model for encoding to obtain a first encoding vector; input the first encoding vector and the sentence to be translated into the second encoder of the translation model for encoding to obtain a second encoding vector; input the second encoding vector into the decoder of the translation model for decoding to obtain the translation of the sentence to be translated; splice the translations of the sentences to be translated to obtain the translation of the original text. The specific splicing method is to arrange the translations of the sentences in the order of the sentences in the original text accordingly.
[0109] In one implementation of the embodiment of the present invention, the method of translating the original text in S202 may specifically be: extracting each part of the original text according to a preset text content extraction strategy, and generating a translation filling template; inputting each part of the extracted content into a pre-trained translation model in sequence to obtain a translation of each part of the content; and filling the content with the translation of each part of the content based on the translation filling template to obtain a translation of the original text. The extraction strategy may be a preset text content extraction strategy.
[0110] The text that the user uses for machine translation generally has various layout styles (fonts, paragraphs, table styles, artistic characters, headers and footers, comments and revision marks, etc.) that the creator (or user) is used to, and there are also various formats of formulas, graphics, tables, mind maps, flow charts, videos, audio files and other types of elements in the document. In order to meet the user's habits and improve the user experience, the generated translation should also be typeset according to the typesetting method of the original text. Therefore, in the embodiment of the present invention, according to the preset text content extraction strategy, for example, extraction by paragraph, extraction by sentence, extraction by table, etc., the various parts of the content in the document are extracted, and a translation filling template is generated. The translation filling template stipulates which paragraph, which sentence or which row and column in the table the translation of each part of the content should be filled into, etc., and the extracted parts of the content are sequentially input into the pre-trained translation model to obtain the translation of each part of the content, and then based on the translation filling template, the translation of each part of the content is used to fill the content to obtain the translation of the original text. The translation filling template defines the same typesetting style as the original text, thus ensuring that the typesetting of the translation is the same as the original text.
[0111] Specifically, the above steps of extracting various parts of the original text according to the preset text content extraction strategy and generating the translation filling template can be specifically: extracting the content of each paragraph in the original text according to the paragraph division, and generating the translation filling template based on the paragraph.
[0112] In an implementation of the embodiment of the present invention, before executing S202, the method may further execute: obtaining the designated language selected by the user through the translation interface; identifying the original language of the original text, or obtaining the original language of the original text selected by the user through the translation interface. Accordingly, S202 may specifically be: using a pre-trained translation model to translate the original text to obtain a translation of the original text in the designated language, wherein the translation model is a model trained using a corpus sample of the original language to translate the original language into the designated language.
[0113] After obtaining the original text, the back-end server can perform language identification on the original text. The specific identification method can be: randomly extracting a number of words from the original text, identifying the language to which these words belong. If the words exceeding a preset threshold among these words belong to the same language, it can be determined that the original text is in this language. Of course, other methods of text language identification, such as the use of neural networks, also fall within the scope of protection of the present invention. In some special cases, a text may contain words in multiple languages, which may cause errors in language recognition. For example, in a document with a mixed layout of Chinese and English, English is the majority of the randomly extracted words. The back-end server recognizes the document as being in English, but in fact the entire document is mostly in Chinese. In order to avoid recognition errors, an original text language selection option can be provided on the translation interface. After the back-end server recognizes the language of the original text, it sends the language type to the client, and the front-end device can display the recognized language on the selection option. If the user finds that the language recognition is wrong, the user can intervene and select the correct language in the selection box of the selection option, such as a drop-down box or a pop-up selection box, to make adjustments. After the user adjusts to the new language type, the back-end server records the change and gives priority to the new language type for translation during machine translation. As a specific embodiment, if the user takes the initiative to adjust the language type, the back-end server records this change in the language adjustment log, which records the original automatic recognition language type, the language type specified by the user, the vocabulary randomly extracted this time, and the random function called in the recognition. This language adjustment log can be used for research and development personnel to improve the performance of the language automatic recognition module. Of course, the back-end server may not provide a language recognition function, and the user may select the original language of the original text on the language selection item of the translation interface after uploading the original text. In the case where the user does not check the language, after the back-end server receives the original text, the automatic recognition module can be started to automatically recognize the original text, and the text document can be translated after the recognition is completed; it can also be that after the back-end server receives the original text, the various parts of the original text are extracted, and then the automatic recognition module is started to randomly extract words from the various parts of the original text, and then the language type is recognized. An optimal implementation is that the back-end server sends the original text to the language automatic identification module and the format conversion module for separate processing to improve processing efficiency. After the server obtains the various contents of the original text and the automatically identified language type, it enters the machine translation module.
[0114] The translation interface may also provide a translation language selection option, and users may select a specified language in the selection box of the selection option such as a drop-down box or a pop-up selection box according to their own needs. Since different translation models are required for translation of different languages, the original text is translated using a pre-trained translation model to obtain a translation of the original text in a specified language, wherein the translation model is a model trained using a corpus sample of the original language to translate the original language into a specified language.
[0115] In actual applications, some texts contain more than two languages. When translating, the user can specify one of the languages as the main language. When performing machine translation, the translation model corresponding to the main language is selected to translate the text content in the main language of the original text into the target language, while the content in other languages can remain unchanged from the original text.
[0116] Of course, in another implementation method, you can select translation models corresponding to different languages according to the languages contained in the original text, and then input the text contents of different languages into their corresponding translation models respectively to obtain the target language translation of each part of the content, and then according to the content of the original text, splice the translations of each part of the content and other operations to obtain the translation of the original text.
[0117] In an implementation of the embodiment of the present invention, before executing S202, the method may further execute: identifying the domain category to which the original text belongs, or obtaining the domain category selected by the user through the translation interface. Accordingly, S202 may specifically be: using a translation model corresponding to the domain category to translate the original text to obtain a translation of the original text, wherein the translation model is a model trained using corpus samples of the domain category.
[0118] After obtaining the original text, the backend server can identify the domain category of the original text. The specific identification method can be: input the original text or each part of the original text into a pre-trained text classification model, and the text classification model identifies the domain category of the original text. Among them, the text classification model is a deep learning model, and the training method is based on a large number of corpus samples. The corpus samples are input into the second network model, and the output of the second network model is compared with the domain category label of the corpus samples to obtain a loss value. If the loss value is greater than or equal to the preset threshold, the parameters of the second network model are adjusted, and a corpus sample is re-input until the loss value obtained is less than the preset threshold. It can be determined that the model training is completed, and the current network model is the text classification model. Among them, the second network model is any pre-selected deep learning model that can realize the text classification function.
[0119] In one implementation of an embodiment of the present invention, the second network model may be an Induction Network, and the training process of the text classification model mainly includes the following steps: the first step is to obtain pre-set field category labels, keywords corresponding to the field category labels, and multiple corpus samples; use pre-trained word vectors to expand the keywords corresponding to the field category labels respectively; encode all keywords and corpus samples into vectorized representations to obtain keyword vectors and corpus sample vectors; classify the corpus sample vectors based on the keyword vectors, and label all corpus samples with field categories based on the classification results; perform a few-sample training on the preset induction network model based on the labeled corpus samples to obtain a text classification model.
[0120] The specific method of encoding all keywords and corpus samples into vectorized representations may be: using a pre-trained bidirectional encoder BERT to encode all keywords and corpus samples to obtain keyword vectors and corpus sample vectors.
[0121] Based on the keyword vector, the specific method of classifying the corpus sample vector can be: based on the keyword vector, the K-nearest neighbor algorithm is used to classify the corpus sample vector. The K-nearest neighbor algorithm (KNN) is a non-parametric statistical method for classification and regression. It uses a vector space model for classification. The concept is that cases of the same category have high similarity to each other, and the possible classification of unknown category cases can be evaluated by calculating the similarity with known category cases.
[0122] Few-shot learning means that after a machine learning model has learned a large amount of data of a certain category, it only needs a small number of samples to quickly learn new categories. The process of few-sample training can be specifically as follows: randomly extracting a first preset number of domain category labels from each domain category label, and for each extracted domain category label, randomly selecting a second preset number of corpus samples with the domain category label as a support set of the text classification model; for each extracted domain category label, randomly selecting a third preset number of corpus samples from the remaining corpus samples with the domain category label as prediction objects; inputting the corpus samples in the support set into a preset induction network model to obtain the domain category of each corpus sample; calculating the loss value between the domain category of each corpus sample obtained by the induction network model and the domain category of each corpus sample in the prediction object; if the loss value is greater than or equal to a preset threshold, adjusting the network parameters of the induction network model, and returning to execute the step of randomly extracting a first preset number of domain category labels from each domain category label, and for each extracted domain category label, randomly selecting a second preset number of corpus samples with the domain category label as a support set of the text classification model; until the loss value is less than the preset threshold, determining that the current induction network model is a text classification model.
[0123] Among them, the induction network model can specifically include: an encoder, a compression network and a relational network; among them, the encoder is used to encode the corpus sample into a training sample vector, which can be composed of BiLSTM (Bi-directional Long Short-Term Memory) and Attention (attention model), the compression network (also called Capsule Network) is used to convert the training sample vector into a class-level vector, and the relational network (also called RelationNetwork) is used to map the relationship between the class-level vector and the domain category.
[0124] When a new domain category label is received, the keywords corresponding to the new domain category label can be set, and then the pre-trained word vectors can be used to expand the keywords corresponding to the new domain category label; the expanded keywords are used to crawl corpus samples, and the crawled corpus samples are labeled with domain categories; the newly labeled corpus samples are used as new samples, and the preset induction network model is trained with a few samples to obtain a text classification model.
[0125] BERT stands for Bidirectional Encoder for Transformers. It is designed to pre-train unlabeled text to obtain deep bidirectional representations by combining the left and right contexts. Therefore, with only one additional output layer, the pre-trained BERT model can be fine-tuned to create SOTA results for various NLP (Natural Langunge Possns) tasks. The Chinese BERT pre-trained model includes simplified and traditional Chinese characters, a total of 12 layers, 768 hidden units, 12 Attention heads, and 110M parameters.
[0126] Pre-trained word vectors are a general term for language models and representation learning techniques in NLP. Conceptually, it means embedding a high-dimensional space with the same dimension as the number of all words into a continuous vector space with a much lower dimension, where each word or phrase is mapped to a vector in the real number field.
[0127] Keyword extraction refers to an automated technology that identifies meaningful and representative segments or words. The keyword extraction technology used in this work is the TWE (Topical Word Embedding) topic model.
[0128] The above-mentioned text classification model training adopts unsupervised classification to construct labeled corpus samples, and then uses few-shot learning for model training. The unsupervised classification method makes it unnecessary to annotate the corpus samples with domain types in advance, reducing the workload of manual annotation. In addition, few-shot learning ensures that after learning a large amount of data of a certain category, only a small number of samples are needed to quickly learn new categories, thereby improving the efficiency of model training.
[0129] Words and sentences have different translations in different fields, such as "claims (which can be translated as claims, declarations)" and "Turkey (which can be translated as turkey, Turkey)". Therefore, there are different translation models corresponding to different fields. When translating, the translation model corresponding to the field category is used to translate the original text to obtain the translation of the original text, wherein the translation model is a model trained using corpus samples of the field category. The specific translation model training process is to input the corpus samples in this field into the above-mentioned first network model for training.
[0130] In another implementation of the embodiment of the present invention, the language of the original text may be first identified, and a language translation model library may be determined based on the language, wherein the language translation model library may contain domain category translation models of multiple domains of the same type of language, and then the domain category of the original text may be identified, and based on the domain category, a corresponding domain category translation model may be selected from the language translation model library to translate the original text. Of course, the domain category of the original text may be first identified, and a translation model library may be determined based on the domain category, wherein the translation model library may contain translation models of different languages, and then the language of the original text may be identified, and based on the language and the target language, a corresponding translation model may be selected from the translation model library to translate the original text. Specifically, the field category can be information, novels, law, finance, medical, papers, e-commerce, military, politics, patents, IT, machinery, geography, transportation, chemical industry, and construction. In another implementation, the field category can also be a vertical field category. One definition of a vertical field refers to a small field that is vertically and longitudinally subdivided under a large field. For example, the field category is patents, and the vertical field of the patent field category is patents in the field of machine translation technology; a vertical field subdivided from the medical field category can be a health field. Specifically, the backend server can store English to Chinese novel field translation models, Chinese to English novel translation models, and so on. There are translation models in different languages and fields that form a translation model library.
[0131] In actual applications, some texts contain texts that belong to more than two different domain categories. When translating, the user can specify one of the domain types as the main domain. When performing machine translation, the translation model corresponding to the domain category is selected to translate the original text. Of course, in another implementation method, the translation models corresponding to different domain categories can be selected according to the domain categories to which the different text contents in the original text belong. Then, the text contents of different domain categories are input into their corresponding translation models respectively to obtain the translations of each part of the content. Then, according to the content of the original text, the translations of each part of the content are spliced to obtain the translation of the original text.
[0132] After the back-end server translates the translation of the original text, the translation is transmitted to the front-end device, and the front-end device displays the translation on the translation interface. For example, in the JAVA programming language environment, the back-end server can specifically use Jodconvert to convert the translation into HTML (HyperText Markup Language) format and transmit it to the front-end device for display. In actual applications, after the back-end server translates the translation of the original text, it can encrypt the translation, and only the user who uploads the original text can view the translation. As a specific embodiment, certain permissions can also be set to ensure document confidentiality, that is, the staff of the background have no permission to view the translation according to the different permissions set, or the desensitized or fragmented translation can also be machine managed. Among them, Jodconvert refers to a document conversion tool of JAVA, which uses OpenOffice (an open source office suite) or LibreOffice (a derivative version of OpenOffice) to convert document formats.
[0133] When translating, different languages have different requirements for translation formats. For example, words in European languages are separated by spaces, while words in East Asian languages are not separated by spaces. Therefore, when translating European languages (such as English, French, etc.), spaces need to be added between words, while East Asian languages (such as Chinese, Thai, etc.) can be translated directly.
[0134] based on Figure 2 The embodiment shown in the figure is a text translation method provided by the embodiment of the present invention, such as Figure 3 As shown, the following steps are included.
[0135] S301, obtaining the original text uploaded by the user via the translation interface provided by the front-end device.
[0136] S302, identifying the attribute information of the original text, and judging whether the original text is of a processable format type according to the attribute information, if so, executing S304, if not, executing S303.
[0137] The attribute information of the original text includes information such as text format, format information, path, number of characters, etc. The attribute information of the original text can be identified by identifying the text format of the original text. The text format can be txt, doc / docx, xls / xlsx, ppt / pptx, pdf, etc.
[0138] The server may pre-store a list of processable format types. The method for determining whether the text format is a processable format type may be to compare the extension name to determine whether it is a format in the format type list. If so, execute step S304; if not, execute step S303.
[0139] S303, converting the text format of the original text into a processable format.
[0140] Specifically, the format conversion module participates in the format conversion operation. The server sends the original text to the format conversion module, and the format conversion module converts the original text into a processable format. For example, the original text input to the format conversion module is in jpg format (a picture format), and the conversion algorithm for converting the picture format to PDF format is used to convert the original text in jpg format into a processable PDF format.
[0141] S304: Translate the original text to obtain a translation of the original text.
[0142] S305: Transmit the translation to the front-end device so that the front-end device displays the translation on a translation interface.
[0143] Generally, the backend server can only translate texts in common formats such as WORD and PDF. In order to meet the user's text translation needs, if the original text uploaded by the user is not in a format that the backend server can process, such as image format, table, mind map, flow chart, etc., it is necessary to first convert the text format of the original text into a processable format, and then translate the original text.
[0144] S301, S304, S305 and Figure 2 The steps in the embodiments shown are the same. For details on how to implement them, refer to Figure 2 shown.
[0145] based on Figure 2 The embodiment shown in the figure is a text translation method provided by the embodiment of the present invention, such as Figure 4 As shown, the following steps are included.
[0146] S401, obtaining the original text uploaded by the user via the translation interface provided by the front-end device.
[0147] S402: Translate the original text to obtain a translation of the original text.
[0148] S403, transmitting the translation to the front-end device, so that the front-end device displays the translation on the translation interface.
[0149] S404: If it is recognized that the user selects a translation editing mode through the translation interface, the translation is set to an editing state so that the user can edit the content in the translation.
[0150] In a specific embodiment of the present invention, after the user chooses to translate a certain original text, the client will jump to the translation display page, which provides at least two columns of display content, one column for displaying the original text, and the other column for displaying the translation. That is, after receiving the translation transmitted by the back-end server, the front-end device can display the original text in the original display column and the translation in the translation display column; and a mode selection control is provided on the translation display page, which can provide the user with whether to perform comparative reading or translation editing. The default mode is comparative reading. If the user selects the translation editing mode, the client will send a trigger instruction to the back-end server. After receiving the trigger instruction, the back-end server sets the translation to the editing state. In the editing state, the client can obtain the user's mouse pointer position change and click action in real time, and the content of the translation can be edited and modified by the user.
[0151] When the above-mentioned translation display page displays the content in two columns, in order to prompt the user of the correspondence between the content in the original text and the content in the translation, so as to facilitate the user to quickly locate the content of the original text and the corresponding translation content, the embodiment of the present invention can provide automatic highlighting display. The specific implementation of automatic highlighting display includes: (1) the back-end server can count the translation frequency of each sentence, count the number of times each sentence has been repeatedly translated, determine the sentences whose translation frequency exceeds a certain threshold, and then send the original text identifiers (which can be the position of the sentence in the original text, the keywords in the sentence, etc.) and the translation identifiers (which can be the position of the sentence in the translation, the keywords in the sentence, etc.) of these sentences to the front-end device, and the front-end device will highlight the corresponding sentences in the original text and the translation by marking the background color with yellow, changing the color of the text to red, adding underlines or wavy lines, etc. according to the original text identifier and the translation identifier of the sentence; (2) the user selects a word in the original text or the translation by placing the mouse, clicking the mouse or sliding the area. After recognizing that the user has selected a word, the front-end device sends the word identifier selected by the user to the back-end server. The back-end server determines the corresponding position of the selected content in the original text and the translation according to the word mark selected by the user, and then feeds back the determined position information to the front-end device. The front-end device, according to the position information, highlights the corresponding words in the original text and the translation by marking the background color yellow, turning the color red, adding underline or wavy line, etc.; (3) The user selects a sentence in the original text or the translation by sliding the area, or the user can also select a word or a word in a sentence by placing the mouse or clicking the mouse, and then the front-end device recognizes the sentence between two end marks to which the word or word belongs through symbol recognition. After recognizing that the user has selected a sentence, the front-end device sends the sentence mark selected by the user to the back-end server. The back-end server determines the corresponding position of the selected content in the original text and the translation according to the sentence mark selected by the user, and then feeds back the determined position information to the front-end device. The front-end device, according to the position information, highlights the corresponding sentences in the original text and the translation by marking the background color yellow, turning the color red, adding underline or wavy line, etc. (4) The client receives and saves the one-to-one correspondence between the translation and the original text of each sentence in the original text sent by the backend server. When the client detects the position where the user places the mouse, clicks the mouse, or slides the area, it determines the word pointed to by the mouse point according to the position of the display interface. The client finds the word or the sentence where the word is located, and highlights the location of the word or sentence. At the same time, the translation or original text corresponding to the word or sentence is highlighted. In other words, if the word or sentence comes from the original text, the location of the translation is found according to the correspondence between the original text and the translation, and the translation with the corresponding relationship is highlighted; similarly, if the word or sentence comes from the translation, the original text corresponding to the word or sentence is also highlighted at the same time.
[0152] Since the back-end server is based on the translation model for text translation, the translated sentences may be translated incorrectly, or may not reach the grammar of the text that the user wants, and different users may have different translation habits, so the present invention also provides a function of user-machine translation interaction to help users and machines understand each other, and the translation interface of the front-end device can also provide a translation editing function. Specifically, a translation editing option button can be provided on the page of the translation, and the user can start the translation editing module by clicking the translation editing option button to enter the translation editing mode, or the user can switch to the translation editing mode by double-clicking and clicking the translation on the translation interface. After the translation is set to the editing mode, the user can edit the content in the translation, and the user can edit the translation content directly in the translation, or pop up an edit box, edit in the edit box, and after the editing is completed, the user confirms, close the edit box, and the translation is correspondingly modified to the edited translation, especially, when receiving the user to complete the modification in a certain place of the translation, the similar words or sentences of the whole translation will be modified together into the translation modified by the user.
[0153] In one implementation of an embodiment of the present invention, after executing S404, the method may further include: after identifying the content to be edited selected by the user from the translation, determining the original content corresponding to the content to be edited, and sending a highlight instruction to the front-end device so that the front-end device highlights the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection, or sliding area selection.
[0154] The user can select the content to be edited from the translation by single-clicking, double-clicking or sliding the area. In order to make the user more intuitively observe which sentence is being edited, the front-end device recognizes that the user has selected a sentence from the translation, and sends the sentence identifier selected by the user (which may be the position of the sentence in the translation, the keywords in the sentence, etc.) to the back-end server. The back-end server determines the position of the sentence in the original text according to the sentence identifier selected by the user, and then carries the determined position information in the highlight instruction and feeds it back to the front-end device. After receiving the highlight instruction, the front-end device, according to the position information carried therein, highlights the corresponding sentence in the original text with a yellow background, a red font, an underline or a wavy line, etc. In this way, the user can clearly see the content to be edited in the translation he wants to edit and the corresponding original content in the original text.
[0155] In one implementation of an embodiment of the present invention, after executing S404, the method may further include: when identifying the content to be edited selected by the user from the translation, sending an edit box setting instruction to the front-end device, so that the front-end device displays an edit box or pops up an edit box at a specified position of the translation interface, wherein the position and size of the edit box are adjustable, and the user can edit the content to be edited in the edit box.
[0156] After the user selects the content to be edited from the translation, an edit box setting instruction can be sent to the front-end device to instruct the front-end device to display an edit box or pop up an edit box at a specified location on the translation interface. The user can edit the content to be edited in the edit box. When the edit box pops up or is displayed, the front-end device can also be set to display the words "Please edit" in the receiving edit input area of the edit box to prompt the user to perform the editing operation. After the user completes the editing, click the confirmation button, and the back-end server can update the translation based on the content edited by the user. When the back-end server sends the edit box setting instruction to the front-end device, the edit box setting instruction can also carry the sentence identifier selected by the user. The front-end device can extract the sentence selected by the user from the translation based on the sentence identifier, and then display the sentence selected by the user in the edit box through display settings.
[0157] In one implementation of an embodiment of the present invention, after executing S404, the method may further include: after receiving the translation edited by the user, based on the user edited content, re-translating the sentence to which the user edited content belongs, and transmitting the translation of the sentence to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
[0158] After the user edits certain words, since the user often only pays attention to the editing of certain words and ignores whether the whole sentence is fluent, in order to ensure the fluency of the edited translation, the back-end server can re-translate the sentence to which the user edited content belongs based on the user edited content, and transmit the translated sentence to the front-end device, which can display the translation of the sentence. After seeing the translation, the user can choose whether to replace the original translation according to his own needs.
[0159] S401-S403 and Figure 2 The steps in the embodiments shown are the same. For details on how to implement them, refer to Figure 2 shown.
[0160] based on Figure 2 The embodiment shown in the figure is a text translation method provided by the embodiment of the present invention, such as Figure 5 As shown, the following steps are included.
[0161] S501, obtaining the original text uploaded by the user via the translation interface provided by the front-end device.
[0162] S502: If the original text contains text content in the user-defined terminology library, the corresponding text content in the original text is translated according to the translation rules in the user-defined terminology library, and other text content in the original text is translated according to the general translation rules to obtain a translation of the original text.
[0163] In another specific embodiment, each part of the text content in the original text is translated according to the general translation rules. If the original text contains text content in the user-defined terminology library, the corresponding text content in the translation is replaced according to the translation rules in the user-defined terminology library, and then a translation that complies with the user-defined rules is obtained.
[0164] S503: Transmit the translation to the front-end device so that the front-end device displays the translation on a translation interface.
[0165] In actual applications, users have special agreements for the translation of some words. For example, the English translation of the application is APP, but the user hopes to translate it into yingyongchengxu. Based on these special needs, the user can establish a custom terminology library, which stipulates various special translation rules. The user can upload the custom terminology library to the front-end device through the translation interface, and the front-end device transmits the custom terminology library to the back-end server. After obtaining the original text, the back-end server first compares it word by word in the custom terminology library to check whether there is text content in the custom terminology library in the original text. If so, the corresponding text content in the original text is translated according to the translation rules in the custom terminology library, and other text content is input into the translation model to obtain the translation of other text content, and then the translation obtained based on the custom terminology library and the translation obtained by the translation model are integrated to obtain the translation of the original text. The integration includes splicing.
[0166] In an embodiment of the present invention, the functions of historical translation task query and custom term base query can also be provided on the translation interface, and the user can check which translation tasks have been completed and which custom term bases have been uploaded. Specifically, after receiving a translation transmitted by the back-end server, the front-end device will record the corresponding translation task, for example, in the personal center of the translation interface, record the text name of the original text (obtained when the original text is received), the time of completion of the translation (obtained when the translation transmitted by the back-end server is received), etc., and the back-end server can save the original text, translated text, comparison text, etc. of the completed translation task, then the back-end server can also send the link of the saved text corresponding to the translation task to the front-end device, and the front-end device can simultaneously record the text links of the original text, translated text, and comparison text when recording the translation task, so that when the user queries the translation task, he can directly click The link is downloaded to the corresponding original text, translated text, and control text; after receiving a custom terminology library uploaded by the user, the front-end device will record the custom terminology library information, such as recording the name of the custom terminology library, the upload time of the custom terminology library, etc. in the personal center of the translation interface, and the back-end server can save the custom terminology library after receiving the custom terminology library uploaded by the front-end device. The back-end server can also send the link to save the custom terminology library to the front-end device. When the front-end device records the custom terminology library information, it can also record the link of the custom terminology library at the same time. In this way, when the user queries the custom terminology library, he can directly download the custom terminology library by clicking the link. In addition, corresponding search operations can also be provided, that is, the personal center of the translation interface can provide search, addition and deletion controls for translation tasks and custom terminology libraries. The user can enter the name of the translation task to be searched and the name of the custom terminology library in the search control, click search, and the front-end device can find the corresponding translation task and custom terminology library information according to the name entered by the user, and then display the found translation task and custom terminology library information on the translation interface.
[0167] S501, S503 and Figure 2 S201 and S203 in the embodiment shown are the same. For details on how to implement them, refer to Figure 2 shown.
[0168] based on Figure 2 The embodiment shown in the figure is a text translation method provided by the embodiment of the present invention, such as Figure 6 As shown, the following steps are included.
[0169] S601, obtaining the original text uploaded by the user via the translation interface provided by the front-end device.
[0170] S602: Translate the original text to obtain a translation of the original text.
[0171] S603, transmitting the translation to the front-end device so that the front-end device displays the translation on the translation interface.
[0172] S604, after recognizing that the user selects quality check through the translation interface, multiple sentences are selected in order of translation scores from low to high, and the front-end device is instructed to highlight the multiple sentences to prompt the user to focus on checking the multiple sentences.
[0173] The translation interface can also provide a quality check option. After the user clicks the quality check option, the front-end device will send a quality check instruction to the back-end server. After receiving the quality check instruction, the back-end server will select multiple sentences from the translation in order of the translation scores of each sentence from low to high, and then carry the sentence identifiers of these sentences (such as the position of the sentence in the translation, the keywords in the sentence, etc.) in the highlight instruction and feed it back to the front-end device. After receiving the highlight instruction, the front-end device will highlight the corresponding sentences in the translation by marking the background color with yellow, turning the text color red, adding underlines or wavy lines, etc. according to the sentence identifiers carried therein. In this way, the user can intuitively see which sentences have lower translation scores, and can focus on checking these sentences.
[0174] In an embodiment of the present invention, a method for scoring the translation of sentences in a translation may specifically be: for each sentence in an original text uploaded by a user through a translation interface, the sentence is input into a pre-trained translation model to obtain multiple translations of the sentence and the translation accuracy of each translation; and based on the translation accuracy of each translation, a translation score of the sentence is determined.
[0175] For each sentence in the original text, the translation model will generate multiple translations, and each translation has a translation accuracy. When determining the translation, you can choose the translation with the highest accuracy. After obtaining the translation accuracy of each translation, you can determine the translation score of the sentence based on the translation accuracy of each translation and according to a certain scoring strategy. For example, if the translation accuracy of each translation of the sentence is less than a preset threshold, you can set a lower score. If the translation accuracy of each translation of the sentence exceeds the preset threshold, you can set a higher score.
[0176] based on Figure 2 The embodiment shown in the figure is a text translation method provided by the embodiment of the present invention, such as Figure 7 As shown, the following steps are included.
[0177] S701, obtaining the original text uploaded by the user via the translation interface provided by the front-end device.
[0178] S702: Translate the original text to obtain a translation of the original text.
[0179] S703, transmitting the translation to the front-end device so that the front-end device displays the translation on the translation interface.
[0180] S704, after identifying that the user selects to download the text via the translation interface, identifying the download mode selected by the user via the translation interface, wherein the download mode includes translation text download and comparison text download. If the download mode selected by the user is translation text download, S705 is executed, and if the download mode selected by the user is comparison text download, S706 is executed.
[0181] S705: Generate a translation text according to the specified text format based on the translation, and send the translation text to the front-end device for the user to download.
[0182] S706, based on the preset text content division strategy, add the translation of each part of the content after the original text of the translation is divided into parts, and after the addition is completed, generate a comparison text according to the specified text format; send the comparison text to the front-end device for the user to download.
[0183] The translation interface also provides a text download option. After the user clicks the text download option, a dialog box will pop up to let the user select the download mode. The download modes include translation text download and comparison text download. The default download mode is translation text download. When the user selects the translation text download mode, the front-end device recognizes that the download mode selected by the user is translation text download, and then sends a translation text download instruction to the back-end server. After receiving the instruction, the back-end server can generate the translation text according to the specified text format (such as WORD, PDF, etc.) according to the translation, and then send the translation text to the front-end device, and the user can download the translation text. When the user selects the comparison text download mode, the front-end device recognizes that the download mode selected by the user is comparison text download, and then sends a comparison text download instruction to the back-end server. After receiving the instruction, the back-end server adds the translation of the content after each part of the original text of the translation based on the preset text content division strategy (for example, by paragraph division), and after the addition is completed, generates the comparison text according to the specified text format, and then sends the comparison text to the front-end device, and the user can download the comparison text.
[0184] To sum up, the overall process of text translation by the translation system is as follows: Figure 8 As shown, users access the platform, such as Fig. 9Upload the original text in the translation interface shown, select the field and language, and click Translate Now to start the internal translation process of the backend server. The backend server first identifies the text category, reads the text content, inputs the translation model sentence by sentence for translation, and then integrates and stores the translation. After the translation is completed, the original translation is displayed. The user selects the comparison reading mode or the post-translation editing mode. Fig.10 As shown in the figure, the comparative reading mode is usually the default mode. In the post-editing mode, the sentence to which the word belongs is machine translated based on the word modified by the user. After the user confirms the modification, the editing result is saved. The user clicks the Download Translation button and selects the translation download mode (translation text download or original translation comparative text download) in the pop-up dialog box. Fig.11 As shown, once the download is completed, the translation of the entire text is completed. Historical translation tasks can be managed in the personal center.
[0185] The specific method of inputting the translation model sentence by sentence for translation is as follows: according to the domain category and language of the original text, a translation model that meets the domain category and language is selected, and then each sentence in the original text is input into the selected translation model in turn for translation to obtain the translation of the sentence. For sentences in languages other than the above-selected languages, since the translation model cannot translate these sentences, the original language of these sentences is retained unchanged in the translation.
[0186] The specific method of integrating the translation is: typeset the corresponding translation according to the typeset order of each sentence and each paragraph in the original text; for tables, etc., typeset the translation according to the rows and columns of the original table; and the translation of the original text is obtained through typeset integration.
[0187] After obtaining the translation, the backend server can generate the translation text according to the specified text format, and add the translation of each paragraph of the original text according to the segmentation method in the original text, generate the comparison text according to the specified text format, and then store both the translation text and the comparison text in the local database of the front-end device, so that the subsequent user can quickly find the corresponding format text for the user to download after initiating a download instruction. The front-end device can be multiple front-end devices.
[0188] The presentation method of the original translation comparison display can be: (1) setting a two-column display box in the translation interface, one column display box displays the original text, and the other column display box displays the translation; (2) setting a one-column display box in the translation interface, in which the display is displayed in the form of one line of original text and one line of translation; (3) setting a one-column display box in the translation interface, in which the display is displayed in the form of one paragraph of original text and one paragraph of translation.
[0189] The back-end server translates the original document as follows: Fig.12As shown, first, it is necessary to identify the text format and determine whether it is a processable text format. If not, perform text format conversion. If so, mark the paragraphs of the original text, extract the text according to the paragraphs, generate a text skeleton, and the text skeleton is a template for filling in the translation. The translation model is used to translate each paragraph to generate a translation result. The translation result is used to fill in the text skeleton, convert it into HTML, generate the translation text, and finally save the translation text.
[0190] The architecture of the translation system is as follows Fig.13 As shown, it includes a front end and external requests (used to receive translation requests from users, where the translation requests include the original text to be translated), permission management (used to manage permissions for operable translations, i.e., to set which personnel can view and edit translations), a configuration management center (used to manage system configuration), a gateway and public applications (used to manage and set gateways, public applications, etc. In an embodiment of the present invention, translation applications can be managed, specifically, multiple translation models can be set, and different translation models can be used for translations in different languages and different fields), a service registration center (used to manage user registration information) and unified log collection (used to collect log information, including which translation tasks have been done, which custom term bases have been uploaded, etc.).
[0191] After translating a text, users often need to download the translated text, but current translation software and translation websites do not provide download services. To address this problem, an embodiment of the present invention provides a text download method, such as Fig.14 As shown, the method includes the following steps.
[0192] S1401, receiving a download instruction initiated by a user via a translation interface provided by a front-end device.
[0193] S1402, obtaining a translation corresponding to the download instruction.
[0194] S1403, identifying the download mode selected by the user through the translation interface contained in the download instruction, wherein the download mode includes translation text download and comparison text download. If the download mode selected by the user is translation text download, S1404 is executed, and if the download mode selected by the user is comparison text download, S1405 is executed.
[0195] S1404: Generate a translation text according to the specified text format based on the translation, and send the translation text to the front-end device for the user to download.
[0196] S1405, based on the preset text content division strategy, add the translation of each part of the content after the original text of the translation is divided into parts, and after the addition is completed, generate a comparison text according to the specified text format; send the comparison text to the front-end device for the user to download.
[0197] The translation interface of the front-end device provides a text download option. After the user clicks the text download option, a dialog box will pop up to let the user select the download mode, which includes translation text download and comparison text download. When the user selects the translation text download mode, the front-end device recognizes that the download mode selected by the user is translation text download, and will send a translation text download instruction to the back-end server. After receiving the instruction, the back-end server can generate the translation text according to the specified text format (such as WORD, PDF, etc.) according to the translation, and then send the translation text to the front-end device, and the user can download the translation text. When the user selects the comparison text download mode, the front-end device recognizes that the download mode selected by the user is comparison text download, and will send a comparison text download instruction to the back-end server. After receiving the instruction, the back-end server adds the translation corresponding to the content after each part of the original text of the translation based on the preset text content division strategy (for example, by paragraph division), and after the addition is completed, the comparison text is generated according to the specified text format, and then the comparison text is sent to the front-end device, and the user can download the comparison text.
[0198] After translating a text, users are often concerned about whether the translation is accurate. However, checking the entire text will undoubtedly bring a huge workload to the user. In order to address this problem, an embodiment of the present invention provides a quality inspection method, such as Fig.15 As shown, the method includes the following steps.
[0199] S1501, receiving a quality inspection instruction, wherein the quality inspection instruction is initiated by a user via a translation interface provided by a front-end device.
[0200] S1502, selecting a plurality of sentences from the translation to be checked in order of translation scores of the sentences from low to high.
[0201] S1503, instructing the front-end device to highlight the multiple sentences to prompt the user to focus on checking the multiple sentences.
[0202] The translation interface of the front-end device provides a quality check option. After the user clicks the quality check option, the front-end device will send a quality check instruction to the back-end server. After receiving the quality check instruction, the back-end server will select multiple sentences from the translation in order of the translation scores of each sentence from low to high, and then carry the sentence identifiers of these sentences (such as the position of the sentence in the translation, the keywords in the sentence, etc.) in the highlight instruction and feed it back to the front-end device. After receiving the highlight instruction, the front-end device will highlight the corresponding sentences in the translation by marking the background color with yellow, changing the text color to red, adding underlines or wavy lines, etc. according to the sentence identifiers carried therein. In this way, the user can intuitively see which sentences in the translation have lower translation scores, and can focus on checking these sentences.
[0203] In one implementation of an embodiment of the present invention, a method for scoring the translation of sentences in a translation may specifically be: for each sentence in the original text uploaded by the user through the translation interface, the sentence is input into a pre-trained translation model to obtain multiple translations of the sentence and the translation accuracy of each translation; based on the translation accuracy of each translation, the translation score of the sentence is determined.
[0204] For each sentence in the original text, the translation model will generate multiple translations, and each translation has a translation accuracy. When determining the translation, you can choose the translation with the highest accuracy. After obtaining the translation accuracy of each translation, you can determine the translation score of the sentence based on the translation accuracy of each translation. For example, if the translation accuracy of each translation of the sentence is less than a preset threshold, you can set a lower score. If the translation accuracy of each translation of the sentence exceeds the preset threshold, you can set a higher score.
[0205] Specifically, the method may further include: checking the original text of the translation to identify errors in the original text; and instructing the front-end device to prompt errors in the original text. Errors include misspelled words, grammatically incorrect sentences, abnormal fonts before and after, and other omissions.
[0206] The embodiment of the present invention can also provide a quality inspection function for the original text. By inspecting the original text, erroneous sentences with errors in word spelling, semantic logic, etc. in the original text are identified, and then the sentence identifiers of these erroneous sentences (such as the position of the sentence in the translation, keywords in the sentence, etc.) are carried in the highlight instruction and fed back to the front-end device. After receiving the highlight instruction, the front-end device highlights the corresponding erroneous sentences in the original text by marking the background color with yellow, changing the text color to red, adding underlines or wavy lines, etc. according to the sentence identifiers carried therein.
[0207] Specifically, in the step of instructing the front-end device to prompt the erroneous content in the original text, in addition to highlighting, a pop-up window prompt can be provided to the user, or a right-click menu can be provided to display multiple recommended modification suggestions in the right-click menu.
[0208] In actual applications, users have special agreements on the translation of some words. For example, the English translation of the application is APP, but the user hopes to translate it into yingyongchengxu. The current translation method cannot meet this user demand. In order to address this problem, the embodiment of the present invention provides a text translation method, such as Fig.16 As shown, the method includes the following steps.
[0209] S1601, obtaining the original text and the custom terminology library uploaded by the user through the translation interface provided by the front-end device.
[0210] S1602, identifying whether the original text contains text content in the custom term base.
[0211] S1603: If it exists, the corresponding text content in the original text is translated according to the translation rules in the custom term base, and other text content in the original text is translated according to the general translation rules to obtain the translation of the original text.
[0212] In an embodiment of the present invention, a user can establish a custom terminology library according to special needs, and various special translation rules are agreed upon in the custom terminology library. The user can upload the custom terminology library to the front-end device through the translation interface, and the front-end device transmits the custom terminology library to the back-end server. After obtaining the original text, the back-end server first compares it word by word in the custom terminology library to check whether there is text content in the custom terminology library in the original text. If so, the corresponding text content in the original text is translated according to the translation rules in the custom terminology library, and other text content is input into the translation model to obtain the translation of the other text content, and then the translation obtained based on the custom terminology library and the translation obtained by the translation model are spliced to obtain the translation of the original text.
[0213] In practical applications, since machine translated sentences are more mechanical, and different users may have different translation habits or different translation requirements, the present invention provides a text translation editing method to better adapt to user habits. Fig.17 As shown, the method includes the following steps.
[0214] S1701, obtaining the original text uploaded by the user via the translation interface provided by the front-end device, and translating the original text to obtain the translation of the original text displayed on the translation interface.
[0215] S1702, when it is recognized that the user selects a translation editing mode through the translation interface, the translation is set to an editing state so that the user can edit the content in the translation.
[0216] The translation interface of the front-end device provides a translation editing function. Specifically, a translation editing option can be provided on the translation page. The user can enter the translation editing mode by clicking the translation editing option, or the user can switch to the translation editing mode by double-clicking a word. After the translation is set to the editing state, the user can edit the content in the translation. The user can edit the translation content directly in the translation, or edit it in the pop-up editing box. After the user completes the editing, the translation is modified to the edited translation accordingly by clicking the confirmation button or closing the editing box. In particular, when the translation is modified somewhere, similar words or sentences throughout the translation will be modified together to the user's modified translation.
[0217] In one implementation of an embodiment of the present invention, after executing S1702, the method may further include: after identifying the content to be edited selected by the user from the translation, determining the original content corresponding to the content to be edited, and sending a highlight instruction to the front-end device so that the front-end device highlights the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection, or sliding area selection.
[0218] The user can select the content to be edited from the translation by single-clicking, double-clicking or sliding the area. In order to make the user more intuitively observe which sentence is being edited, the front-end device recognizes that the user has selected a sentence from the translation, and sends the sentence identifier selected by the user (which may be the position of the sentence in the translation, the keywords in the sentence, etc.) to the back-end server. The back-end server determines the position of the sentence in the original text according to the sentence identifier selected by the user, and then carries the determined position information in the highlight instruction and feeds it back to the front-end device. After receiving the highlight instruction, the front-end device highlights the corresponding sentence in the original text with a yellow background, a red font, an underline or a wavy line, etc. according to the position information carried therein. In this way, the user can clearly see the content to be edited in the translation he wants to edit and the corresponding original content in the original text.
[0219] In one implementation of the embodiment of the present invention, after executing S1702, the method may further include: after identifying the content to be edited selected by the user from the translation, sending an edit box setting instruction to the front-end device, so that the front-end device displays the edit box or pops up the edit box at a specified position of the translation interface, and the user can edit the content to be edited in the edit box. Among them, the position and size of the edit box are adjustable. Specifically, the display or pop-up position of the edit box has an initial default value. A preferred implementation is that the position and size of the edit box are set to be fixed relative to the display interface of the front-end device, so that when the user drags the scroll bar up and down or left and right during the editing process, the edit box can always be in a relatively fixed position and maintain a fixed size. After identifying that the user selects the edit box and has a drag operation, the front-end device adjusts the position of the edit box to the corresponding position in response to the user's selection and drag operation. The optional way to select the edit box is to click the non-editing area of the edit box. After identifying that the user selects the edit box and has a zoom operation, the front-end device adjusts the size of the edit box to the corresponding size in response to the user's selection and zoom operation. The optional ways of zooming operation are zoom gestures, clicking on the zoom-in or zoom-out button, etc.
[0220] After the user selects the content to be edited from the translation, an edit box setting instruction can be sent to the front-end device to instruct the front-end device to display an edit box or pop up an edit box at a specified location on the translation interface. The user can edit the content to be edited in the edit box. When the edit box pops up or displays, the front-end device can also be set to display the words "Please edit" in the edit box to prompt the user to perform the editing operation. After the user completes the editing, click the confirmation button, and the back-end server can update the translation based on the content edited by the user. When the back-end server sends the edit box setting instruction to the front-end device, the edit box setting instruction can also carry the sentence identifier selected by the user. The front-end device can extract the sentence selected by the user from the translation based on the sentence identifier, and then display the sentence selected by the user in the edit box through display settings.
[0221] In an implementation of the embodiment of the present invention, an input prompt text is displayed in the edit box, and the input prompt text is used to instruct the user to update the content to be edited according to the input prompt text;
[0222] The method may further include: obtaining text content input by the user in the edit box for the input prompt text, and updating the translation.
[0223] In one implementation of an embodiment of the present invention, after executing S1702, the method may further include: after receiving the translation edited by the user, based on the user edited content, re-translating the sentence to which the user edited content belongs, and transmitting the translation of the sentence to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
[0224] After the user edits certain words, since the user often only pays attention to the editing of certain words and ignores whether the whole sentence is fluent, in order to ensure the fluency of the edited translation, the back-end server can re-translate the sentence to which the user edited content belongs based on the user edited content, and transmit the translated sentence to the front-end device, which can display the translation of the sentence. After seeing the translation, the user can choose whether to replace the original translation according to his own needs.
[0225] Based on the above method embodiment, the present invention provides a text translation device, such as Fig.18 As shown, the device may include:
[0226] The obtaining module 1810 is used to obtain the original text uploaded by the user through the translation interface provided by the front-end device;
[0227] The translation module 1820 is used to translate the original text to obtain a translation of the original text;
[0228] The transmission module 1830 is used to transmit the translation to the front-end device so that the front-end device displays the translation on the translation interface.
[0229] Optionally, the translation module 1820 can be specifically used to: extract each part of the content in the original text according to a preset text content extraction strategy, and generate a translation filling template; input the extracted parts of the content into a pre-trained translation model in sequence to obtain the translation of each part of the content; based on the translation filling template, use the translation of each part of the content to fill in the content to obtain the translation of the original text.
[0230] Optionally, the translation module 1820 may be specifically used to extract the content of each paragraph in the original text according to the paragraph division, and generate a translation filling template with the paragraph as the unit.
[0231] Optionally, the device may further include:
[0232] A recognition module, used to recognize the attribute information of the original text, and determine whether the original text is a processable format type according to the attribute information;
[0233] The translation module 1820 may be specifically configured to: if the recognition result of the recognition module is yes, execute the step of translating the original text to obtain a translation of the original text;
[0234] The conversion module is used to convert the text format of the original text into a processable format if the recognition result of the recognition module is negative.
[0235] Optionally, the obtaining module 1810 may also be used to: obtain the specified language selected by the user through the translation interface; identify the original language of the original text, or obtain the original language of the original text selected by the user through the translation interface;
[0236] The translation module 1820 can be specifically used to: use a pre-trained translation model to translate the original text to obtain a translation of the original text in a specified language, wherein the translation model is a model trained using corpus samples of the original language to translate the original language into the specified language.
[0237] Optionally, the obtaining module 1810 may also be used to: identify the field category to which the original text belongs, or obtain the field category selected by the user through the translation interface;
[0238] The translation module 1820 can be specifically used to: use the translation model corresponding to the domain category to translate the original text to obtain the translation of the original text, wherein the translation model is a model trained using corpus samples of the domain category.
[0239] Optionally, the device may further include:
[0240] The setting module is used to set the translation to an editing state if it is recognized that the user selects the translation editing mode through the translation interface, so that the user can edit the content in the translation.
[0241] Optionally, the setting module can also be used to: after identifying the content to be edited selected by the user from the translation, determine the original content corresponding to the content to be edited, and send a highlight instruction to the front-end device to enable the front-end device to highlight the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection, or sliding area selection.
[0242] Optionally, the setting module can also be used to: after identifying the content to be edited selected by the user from the translation, send an edit box setting instruction to the front-end device, so that the front-end device displays an edit box or pops up an edit box at a specified location in the translation interface, wherein the position and size of the edit box are adjustable, and the user can edit the content to be edited in the edit box.
[0243] Optionally, the translation module 1820 can also be used to: after receiving the translation edited by the user, re-translate the sentence to which the user edited content belongs based on the user edited content, and transmit the translation of the sentence to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
[0244] Optionally, the translation module 1820 can be specifically used for: if there is text content in the user-defined terminology library in the original text, then the corresponding text content in the original text is translated according to the translation rules in the customized terminology library, and other text content in the original text is translated according to the general translation rules to obtain the translation of the original text.
[0245] Optionally, the device may further include:
[0246] The instruction module is used to select multiple sentences in order of translation scores from low to high after recognizing that the user selects quality check through the translation interface, and instruct the front-end device to highlight the multiple sentences to prompt the user to focus on checking the multiple sentences.
[0247] Optionally, the device further comprises:
[0248] The download module is used to identify the download mode selected by the user through the translation interface after identifying that the user chooses to download the text through the translation interface, wherein the download mode includes translation text download and comparison text download; if the download mode selected by the user is translation text download, the translation text is generated according to the specified text format based on the translation, and the translation text is sent to the front-end device for the user to download; if the download mode selected by the user is comparison text download, the translation of the part of the content is added after each part of the original text of the translation is divided based on the preset text content division strategy, and after the addition is completed, the comparison text is generated according to the specified text format; the comparison text is sent to the front-end device for the user to download.
[0249] By applying the embodiment of the present invention, after obtaining the original text uploaded by the user through the translation interface provided by the front-end device, the back-end server translates the original text to obtain the translation of the original text, and then transmits the obtained translation to the front-end device, which displays the translation on the translation interface. It can be seen that the user only needs to upload the original text on the translation interface provided by the front-end device, the front-end device and the back-end server interact, the back-end server translates the original text, and displays the translation of the original text on the front-end device, without the user having to input word by word, which greatly reduces the time consumption of translation, thereby realizing the quick translation of text.
[0250] The embodiment of the present invention also provides a text downloading device, such as Fig.19 As shown, the device may include:
[0251] The receiving module 1910 is used to receive a download instruction initiated by a user via a translation interface provided by a front-end device;
[0252] The acquisition module 1920 is used to acquire the translation corresponding to the download instruction;
[0253] An identification module 1930 is used to identify a download mode selected by the user via the translation interface contained in the download instruction, wherein the download mode includes a translation text download and a comparison text download;
[0254] Processing module 1940 is used to generate a translated text according to the specified text format based on the translation if the download mode selected by the user is translated text download, and send the translated text to the front-end device for the user to download; if the download mode selected by the user is reference text download, based on the preset text content division strategy, add the translation of each part of the content after the original text of the translated text is divided, and after the addition is completed, generate a reference text according to the specified text format; send the reference text to the front-end device for the user to download.
[0255] By applying the embodiment of the present invention, a translation download service is provided, and the user can be provided with the download of the translation text or the download of the comparison text according to the user's needs.
[0256] The embodiment of the present invention also provides a quality inspection device, such as Fig. 20 As shown, the device may include:
[0257] Receiving module 210, used for receiving a quality inspection instruction initiated by a user via a translation interface provided by a front-end device;
[0258] A selection module 220, for selecting a plurality of sentences from the translation to be checked in order of translation scores of the sentences from low to high;
[0259] The instruction module 2030 is used to instruct the front-end device to highlight multiple sentences to prompt the user to focus on checking the multiple sentences.
[0260] Optionally, the device may further include:
[0261] The translation module is used to input each sentence in the original text uploaded by the user through the translation interface into a pre-trained translation model to obtain multiple translations of the sentence and the translation accuracy of each translation;
[0262] The scoring module is used to determine the translation score of the sentence based on the translation accuracy of each translation.
[0263] Optionally, the device may further include:
[0264] The recognition module is used to check the original text of the translation and identify errors in the original text;
[0265] The indication module 2030 can also be used to instruct the front-end device to prompt the erroneous content in the original text.
[0266] By applying the embodiment of the present invention, the translation interface of the front-end device provides a quality check option. After the user clicks the quality check option, the back-end server will determine multiple sentences with the lowest translation scores and instruct the front-end device to highlight the multiple sentences. In this way, the user can intuitively see which sentences have low translation scores and can focus on checking these sentences. The workload caused by the full text check is reduced.
[0267] The embodiment of the present invention also provides a text translation device, such as Fig.21 As shown, the device may include:
[0268] The acquisition module 2110 is used to acquire the original text and the custom terminology library uploaded by the user through the translation interface provided by the front-end device;
[0269] Identification module 2120, used to identify whether there is text content in the custom term library in the original text;
[0270] The translation module 2130 is used to translate the corresponding text content in the original text according to the translation rules in the custom term library if the recognition module 2120 recognizes that it exists, and translate other text content in the original text according to the general translation rules to obtain the translation of the original text.
[0271] By using the embodiment of the present invention, a user can establish a custom terminology library according to special needs, and various special translation rules are agreed upon in the custom terminology library. If the original text contains text content in the user-defined terminology library, the corresponding text content in the original text is translated according to the translation rules in the custom terminology library, and other text content in the original text is translated according to the general translation rules to obtain the translation of the original text. The special needs of users can be met.
[0272] The embodiment of the present invention also provides a text translation and editing device, such as Fig. 22 As shown, the device may include:
[0273] The acquisition module 2210 is used to acquire the original text uploaded by the user through the translation interface provided by the front-end device, and translate the original text to obtain the translation of the original text displayed on the translation interface;
[0274] The setting module 2220 is used to set the translation to an editing state when recognizing that the user selects the translation editing mode through the translation interface, so that the user can edit the content in the translation.
[0275] Optionally, the device may further include:
[0276] The first sending module is used to determine the original content corresponding to the content to be edited after identifying the content to be edited selected by the user from the translation, and send a highlight instruction to the front-end device so that the front-end device highlights the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection or sliding area selection.
[0277] Optionally, the device may further include:
[0278] The second sending module is used to send an edit box setting instruction to the front-end device after identifying the content to be edited selected by the user from the translation, so that the front-end device displays an edit box or pops up an edit box at a specified position of the translation interface, wherein the position and size of the edit box are adjustable, and the user can edit the content to be edited in the edit box.
[0279] Optionally, an input prompt text is displayed in the edit box, and the input prompt text is used to instruct the user to update the content to be edited according to the input prompt text;
[0280] The acquisition module 2210 may also be used to: acquire the text content input by the user in the edit box for the input prompt text, and update the translation.
[0281] Optionally, the device may further include:
[0282] The translation module is used to re-translate the sentence to which the user edited content belongs based on the user edited content after receiving the translated text edited by the user, and transmit the translated text of the sentence to the front-end device so that the front-end device recommends the translated text of the sentence to the user for selection.
[0283] An embodiment of the present invention provides an electronic device, such as Fig.23 As shown, it includes a processor 2301 and a memory 2302, wherein the memory 2302 is used to store computer programs; the processor 2301 is used to implement any of the above methods when executing the computer program stored in the memory.
[0284] The memory may include a RAM (Random Access Memory), or may include a NVM (Non-volatile Memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.
[0285] The above-mentioned processor can be a general-purpose processor, including CPU, NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0286] In addition, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.
[0287] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above methods.
[0288] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, DSL (Digital Subscriber Line, digital subscriber line)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD (Digital Versatile Disc)), or a semiconductor medium (such as an SSD (Solid State Disk)).
[0289] As for the embodiments of the device, electronic device, computer-readable storage medium and computer program product, since the contents of the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple and the relevant parts can be referred to the partial description of the method embodiments.
[0290] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0291] Each embodiment in this specification is described in a related 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 device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0292] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A translation system, characterized in that: The translation system comprises: a front-end device and a back-end server, wherein the front-end device provides a translation interface; The front-end device is used to transmit the original text to the back-end server after receiving the original text uploaded by the user through the translation interface; The back-end server is used to obtain the original text; translate the original text to obtain a translation of the original text; transmit the translation to the front-end device so that the front-end device displays the translation on the translation interface; after recognizing that the user selects quality inspection through the translation interface, select multiple sentences in order from low to high translation scores of each sentence, and instruct the front-end device to highlight the multiple sentences to prompt the user to focus on the multiple sentences. The translation of the original text to obtain the translation of the original text includes: extracting sentences to be translated and specified objects from the original text, wherein the objects include prefixes and / or suffixes; inputting the objects into a first encoder of a translation model for encoding to obtain a first encoding vector; inputting the first encoding vector and the sentence to be translated into a second encoder of the translation model for encoding to obtain a second encoding vector; inputting the second encoding vector into a decoder of the translation model for decoding to obtain a translation of the sentence to be translated; and splicing the translations of the sentences to be translated to obtain a translation of the original text.
2. A text translation method, characterized in that: The method comprises: Obtaining the original text uploaded by the user through the translation interface provided by the front-end device; Translating the original text to obtain a translation of the original text includes: extracting a sentence to be translated and a specified object from the original text, wherein the object includes a prefix and / or a suffix; inputting the object into a first encoder of a translation model for encoding to obtain a first encoding vector; inputting the first encoding vector and the sentence to be translated into a second encoder of the translation model for encoding to obtain a second encoding vector; inputting the second encoding vector into a decoder of the translation model for decoding to obtain a translation of the sentence to be translated; splicing the translations of the sentences to be translated to obtain a translation of the original text; Transmitting the translation to the front-end device so that the front-end device displays the translation on the translation interface; After recognizing that the user selects quality check through the translation interface, multiple sentences are selected in order of translation scores from low to high, and the front-end device is instructed to highlight the multiple sentences to prompt the user to focus on checking the multiple sentences.
3. The method according to claim 2, characterized in that The step of translating the original text to obtain a translation of the original text includes: According to a preset text content extraction strategy, various parts of the original text are extracted, and a translation filling template is generated; Inputting the extracted parts of the content into a pre-trained translation model in sequence to obtain translations of the parts of the content; Based on the translation filling template, the content is filled using the translations of the various parts of the content to obtain the translation of the original text.
4. The method according to claim 3, characterized in that The step of extracting each part of the original text according to the preset text content extraction strategy and generating a translation filling template includes: According to the paragraph division, the content of each paragraph in the original text is extracted, and a translation filling template based on the paragraph is generated.
5. The method according to any one of claims 2 to 4, characterized in that: After the step of obtaining the original text uploaded by the user via the translation interface provided by the front-end device, the method further includes: Identifying attribute information of the original text, and determining whether the original text is in a processable format according to the attribute information; If yes, then the step of translating the original text to obtain a translation of the original text is performed; If not, the text format of the original text is converted into a processable format.
6. The method according to any one of claims 2 to 4, characterized in that: Before the step of translating the original text to obtain a translation of the original text, the method further includes: Obtaining a specified language selected by the user via the translation interface; Identifying the original language of the original text, or obtaining the original language of the original text selected by the user through the translation interface; The step of translating the original text to obtain a translation of the original text includes: The original text is translated using a pre-trained translation model to obtain a translation of the original text in a specified language, wherein the translation model is a model trained using a corpus sample of the original language to translate the original language into the specified language.
7. The method according to any one of claims 2 to 4, characterized in that: Before the step of translating the original text to obtain a translation of the original text, the method further includes: Identify the field category to which the original text belongs, or obtain the field category selected by the user through the translation interface; The step of translating the original text to obtain a translation of the original text includes: The original text is translated using a translation model corresponding to the domain category to obtain a translation of the original text, wherein the translation model is a model trained using corpus samples of the domain category.
8. The method according to claim 2, characterized in that: After the step of transmitting the translation to the front-end device, the method further includes: If it is identified that the user selects the translation editing mode through the translation interface, the translation is set to an editing state so that the user can edit the content in the translation.
9. The method according to claim 8, characterized in that After the step of setting the translation to an editing state, the method further includes: After identifying the content to be edited selected by the user from the translation, the original content corresponding to the content to be edited is determined, and a highlight instruction is sent to the front-end device, so that the front-end device highlights the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection, or sliding area selection.
10. The method according to claim 8 or 9, characterized in that: After the step of setting the translation to an editing state, the method further includes: After identifying the content to be edited selected by the user from the translation, an edit box setting instruction is sent to the front-end device, so that the front-end device displays an edit box or pops up an edit box at a specified position of the translation interface, wherein the position and size of the edit box are adjustable, and the user can edit the content to be edited in the edit box.
11. The method according to claim 8, characterized in that After the step of setting the translation to an editing state, the method further includes: After receiving the translation edited by the user, the sentence to which the user edited content belongs is re-translated based on the user edited content, and the translation of the sentence is transmitted to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
12. The method according to claim 2, characterized in that: The step of translating the original text to obtain a translation of the original text includes: If the original text contains text content from a user-defined term library, the corresponding text content in the original text is translated according to the translation rules in the user-defined term library, and other text content in the original text is translated according to the general translation rules to obtain a translation of the original text.
13. The method according to claim 2, characterized in that After the step of transmitting the translation to the front-end device, the method further includes: After identifying that the user selects to download the text via the translation interface, identifying a download mode selected by the user via the translation interface, wherein the download mode includes downloading the translated text and downloading the reference text; If the download mode selected by the user is the translation text download, a translation text is generated according to the translation and in a specified text format, and the translation text is sent to the front-end device for the user to download; If the download mode selected by the user is comparison text download, based on the preset text content division strategy, the translation of each part of the content is added after the original text of the translation is divided into parts, and after the addition is completed, the comparison text is generated according to the specified text format; the comparison text is sent to the front-end device for the user to download.
14. A text translation and editing method, characterized in that: The method comprises: The method obtains an original text uploaded by a user through a translation interface provided by a front-end device, and translates the original text to obtain a translation of the original text displayed on the translation interface, including: extracting a sentence to be translated and a specified object from the original text, wherein the object includes a prefix and / or a suffix; inputting the object into a first encoder of a translation model for encoding to obtain a first encoding vector; inputting the first encoding vector and the sentence to be translated into a second encoder of the translation model for encoding to obtain a second encoding vector; inputting the second encoding vector into a decoder of the translation model for decoding to obtain a translation of the sentence to be translated; and concatenating the translations of the sentences to be translated to obtain a translation of the original text; When it is recognized that the user selects a translation editing mode via the translation interface, the translation is set to an editing state so that the user can edit the content in the translation; After receiving the translation edited by the user, the sentence to which the user edited content belongs is re-translated based on the user edited content, and the translation of the sentence is transmitted to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
15. The method according to claim 14, characterized in that After the step of setting the translation to an editing state, the method further includes: After identifying the content to be edited selected by the user from the translation, the original content corresponding to the content to be edited is determined, and a highlight instruction is sent to the front-end device, so that the front-end device highlights the content to be edited in the translation and the original content in the original text, wherein the user selects the content to be edited from the translation including: single-click selection, double-click selection, or sliding area selection.
16. The method according to claim 14 or 15, characterized in that After the step of setting the translation to an editing state, the method further includes: After identifying the content to be edited selected by the user from the translation, an edit box setting instruction is sent to the front-end device, so that the front-end device displays an edit box or pops up an edit box at a specified position of the translation interface, wherein the position and size of the edit box are adjustable, and the user can edit the content to be edited in the edit box.
17. The method according to claim 16, characterized in that An input prompt text is displayed in the edit box, and the input prompt text is used to instruct the user to update the content to be edited according to the input prompt text; The method further comprises: The text content input by the user in the edit box for the input prompt text is obtained, and the translation is updated.
18. A text translation device, characterized in that: The device comprises: An acquisition module, used to acquire the original text uploaded by the user via the translation interface provided by the front-end device; A translation module is used to translate the original text to obtain a translation of the original text, including: extracting a sentence to be translated and a specified object from the original text, wherein the object includes a prefix and / or a suffix; inputting the object into a first encoder of a translation model for encoding to obtain a first encoding vector; inputting the first encoding vector and the sentence to be translated into a second encoder of the translation model for encoding to obtain a second encoding vector; inputting the second encoding vector into a decoder of the translation model for decoding to obtain a translation of the sentence to be translated; splicing the translations of the sentences to be translated to obtain a translation of the original text; A transmission module, used for transmitting the translation to the front-end device, so that the front-end device displays the translation on the translation interface; The instruction module is used to select multiple sentences in order from low to high translation scores after recognizing that the user selects quality check through the translation interface, and instruct the front-end device to highlight the multiple sentences to prompt the user to focus on checking the multiple sentences.
19. A text translation and editing device, characterized in that: The device comprises: The acquisition module is used to acquire the original text uploaded by the user through the translation interface provided by the front-end device, and translate the original text to obtain the translation of the original text displayed on the translation interface, including: extracting the sentence to be translated and the specified object from the original text, wherein the object includes a prefix and / or a suffix; inputting the object into the first encoder of the translation model for encoding to obtain a first encoding vector; inputting the first encoding vector and the sentence to be translated into the second encoder of the translation model for encoding to obtain a second encoding vector; inputting the second encoding vector into the decoder of the translation model for decoding to obtain the translation of the sentence to be translated; splicing the translations of the sentences to be translated to obtain the translation of the original text; The setting module is used to set the translation to an editing state when recognizing that the user selects a translation editing mode through the translation interface, so that the user can edit the content in the translation; after receiving the translation edited by the user, based on the user edited content, re-translate the sentence to which the user edited content belongs, and transmit the translation of the sentence to the front-end device, so that the front-end device recommends the translation of the sentence to the user for selection.
20. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory is used to store a computer program; and the processor, when used to execute the computer program stored in the memory, implements: the method described in any one of claims 2 to 13, or the method described in any one of claims 14 to 17.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 2 to 13 or the method according to any one of claims 14 to 17 is implemented.
Citation Information
Patent Citations
Text translation editing method and device, electronic equipment and storage medium
CN111860000A