Translation method, device, equipment and storage medium

文档序号:342909 发布日期:2021-12-03 浏览:28次 中文

阅读说明:本技术 翻译方法、装置、设备和存储介质 (Translation method, device, equipment and storage medium ) 是由 周凤鸣 赵宇 于 2020-05-28 设计创作,主要内容包括:本发明实施例提供一种翻译方法、装置、设备和存储介质,该方法包括:获取待翻译语句以及此语句的属性信息。然后,根据此属性信息,在翻译记忆库中确定与待翻译语句对应的目标语句,其中,目标语句与待翻译语句的属性信息匹配。进一步,再从翻译记忆库中确定与目标语句对应的译文,此译文也即是待翻译语句的译文,从而完成翻译。可见,上述提供的翻译方法是通过对待翻译语句以及翻译记忆库中的语句进行属性信息的设置,再根据设置的属性信息自动匹配出译文的过程,也即是实现自动翻译,大大提高翻译效率。(The embodiment of the invention provides a translation method, a translation device, translation equipment and a storage medium, wherein the method comprises the following steps: and acquiring the statement to be translated and the attribute information of the statement. And then, according to the attribute information, determining a target sentence corresponding to the sentence to be translated in the translation memory base, wherein the target sentence is matched with the attribute information of the sentence to be translated. Further, a translation corresponding to the target sentence is determined from the translation memory library, and the translation is also the translation of the sentence to be translated, so that the translation is completed. Therefore, the translation method provided by the invention is a process of setting the attribute information of the sentence to be translated and the sentence in the translation memory base and automatically matching the translated sentence according to the set attribute information, namely, the automatic translation is realized, so that the translation efficiency is greatly improved.)

1. A method of translation, comprising:

acquiring a statement to be translated and attribute information of the statement to be translated;

determining a target statement corresponding to the statement to be translated in a translation memory according to the attribute information, wherein the attribute information of the target statement is matched with the attribute information of the statement to be translated;

and determining the translation corresponding to the target sentence in the translation memory base as the translation corresponding to the sentence to be translated.

2. The method according to claim 1, wherein the obtaining the sentence to be translated and the attribute information corresponding to the sentence to be translated includes:

acquiring a file to be translated and attribute information of the file to be translated;

performing sentence division processing on the file to be translated to obtain the sentence to be translated;

and determining the attribute information of the file to be translated as the attribute information of the sentence to be translated.

3. The method of claim 2, wherein the attribute information comprises: at least one item of version information of the file to be translated, the applicable field of the translated file and product information of an applicable product.

4. The method of claim 3, wherein matching the attribute information of the target sentence with the attribute information of the sentence to be translated comprises: and the application field and/or the product information of the applicable product corresponding to the sentence to be translated and the target sentence are the same.

5. The method according to claim 1, wherein the determining, according to the attribute information, a target sentence corresponding to the sentence to be translated in a translation memory includes:

determining at least one alternative sentence matched with the attribute information of the sentence to be translated in the translation memory base;

determining semantic similarity between the sentence to be translated and the at least one alternative sentence;

and determining the candidate sentences the semantic similarity of which meets the requirement as the target sentences.

6. The method of claim 1, wherein the translation memory is plural;

determining a target sentence corresponding to the sentence to be translated in a translation memory according to the attribute information, wherein the determining comprises the following steps:

determining at least two alternative memory banks matched with the attribute information of the statement to be translated from the translation memory banks according to the respective attribute information of the translation memory banks, wherein the attribute information associated with the translation memory banks is the attribute information of the statement in the translation memory banks;

determining at least two alternative sentences meeting the requirement of semantic similarity with the sentence to be translated in the at least two alternative memory libraries;

and determining the alternative sentence corresponding to the highest weight value as the target sentence according to the weight value of the alternative memory base to which the at least two alternative sentences belong respectively.

7. The method of claim 1, further comprising:

responding to modification operation triggered by a user on the translation, and acquiring a modified translation;

and storing the association relation between the statement to be translated and the modified translation into the translation memory bank.

8. The method of claim 1, further comprising:

if the target sentence corresponding to the sentence to be translated does not exist in the translation memory base, outputting the sentence to be translated for manual translation processing;

and acquiring a translation which is input by a user and corresponds to the sentence to be translated.

9. The method of claim 8, further comprising:

and responding to the updating operation triggered by the user, and storing the association relation between the statement to be translated and the translation input by the user to the translation memory.

10. The method according to claim 1, wherein the obtaining the sentence to be translated and the attribute information of the sentence to be translated comprises:

responding to a sending operation triggered by the user in a document editing system, and receiving the file to be translated sent by the document editing system;

responding to an input operation triggered by a user in a document editing system, and receiving attribute information of the file to be translated, which is sent by the document editing system;

and determining the attribute information of the statement to be translated according to the attribute information of the file to be translated.

11. A translation apparatus, comprising:

the system comprises an acquisition module, a translation module and a translation module, wherein the acquisition module is used for acquiring a statement to be translated and attribute information of the statement to be translated;

a first determining module, configured to determine, according to the attribute information, a target sentence corresponding to the sentence to be translated in a translation memory, where the attribute information of the target sentence matches the attribute information of the sentence to be translated;

and the second determining module is used for determining that the translation corresponding to the target sentence in the translation memory base is the translation corresponding to the sentence to be translated.

12. An electronic device, comprising: a memory, a processor; wherein the memory has stored thereon executable code which, when executed by the processor, causes the processor to perform the translation method of any of claims 1 to 10.

13. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the translation method of any one of claims 1 to 10.

Technical Field

The present invention relates to the field of computer technologies, and in particular, to a translation method, apparatus, device, and storage medium.

Background

With the development of the internet, various aspects of communication between users in different languages are becoming more and more compact. For example, a user may obtain information from around the world, or a product may be sold around the world. Translation is an essential link for the dissemination of information or the sale of products.

Taking product sales as an example, all the contents related to the product, such as product specifications, characters displayed in a product operation interface, and the like, need to be translated into corresponding languages while the product is sold, so that users in the languages can use the product normally. For the above-mentioned contents needing translation, conventional manual translation is usually adopted, so that the translation efficiency is low.

Disclosure of Invention

In view of this, embodiments of the present invention provide a translation method, apparatus, device and storage medium, so as to improve translation efficiency.

In a first aspect, an embodiment of the present invention provides a translation method, including:

acquiring a statement to be translated and attribute information of the statement to be translated;

determining a target statement corresponding to the statement to be translated in a translation memory according to the attribute information, wherein the attribute information of the target statement is matched with the attribute information of the statement to be translated;

and determining the translation corresponding to the target sentence in the translation memory base as the translation corresponding to the sentence to be translated.

In a second aspect, an embodiment of the present invention provides a translation apparatus, including:

the system comprises an acquisition module, a translation module and a translation module, wherein the acquisition module is used for acquiring a statement to be translated and attribute information of the statement to be translated;

a first determining module, configured to determine, according to the attribute information, a target sentence corresponding to the sentence to be translated in a translation memory, where the attribute information of the target sentence matches the attribute information of the sentence to be translated;

and the second determining module is used for determining that the translation corresponding to the target sentence in the translation memory base is the translation corresponding to the sentence to be translated.

In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory is used to store one or more computer instructions, and when executed by the processor, the one or more computer instructions implement the translation method in the first aspect. The electronic device may also include a communication interface for communicating with other devices or a communication network.

In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to implement at least the translation method according to the first aspect.

The translation method provided by the embodiment of the invention obtains the statement to be translated and the attribute information of the statement. And then determining a target statement corresponding to the statement to be translated in a translation memory according to the attribute information, wherein the attribute information of the target statement is matched with the attribute information of the statement to be translated. Because the translation memory library stores the sentence pair formed by the original sentence and the translated sentence, the translated sentence corresponding to the target sentence can be further determined from the translation memory library, and the translated sentence is also the translated sentence of the sentence to be translated, so that the translation is completed.

As can be seen from the above description, the translation method provided in the embodiment of the present invention sets attribute information of a sentence to be translated and a sentence in a translation memory, automatically matches a target sentence according to the set attribute information, and obtains a translated text, that is, realizes automatic translation, thereby greatly improving translation efficiency.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

FIG. 1 is a flowchart of a translation method according to an embodiment of the present invention;

fig. 2a is a flowchart of a sentence to be translated and an attribute information obtaining method according to an embodiment of the present invention;

fig. 2b is a flowchart of another method for acquiring statements to be translated and attribute information according to an embodiment of the present invention;

FIG. 3a is a flowchart of a target sentence determination method according to an embodiment of the present invention;

FIG. 3b is a flowchart of another target sentence determination method according to an embodiment of the present invention;

FIG. 4 is a flowchart of another translation method provided by embodiments of the present invention;

FIG. 5 is a diagram illustrating a translation interface according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of another translation interface provided by embodiments of the present invention;

FIG. 7 is a schematic structural diagram of a translation apparatus according to an embodiment of the present invention;

fig. 8 is a schematic structural diagram of an electronic device corresponding to the translation apparatus provided in the embodiment shown in fig. 7;

fig. 9 is a schematic diagram of a translation method provided in an embodiment of the present invention in an e-commerce platform scenario.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.

It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.

The words "if," "if," as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a recognition," depending on the context. Similarly, the phrases "if determined" or "if identified (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when identified (a stated condition or event)" or "in response to an identification (a stated condition or event)", depending on the context.

It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.

Before explaining the translation method provided by the embodiment of the present invention, an exemplary explanation may be first made on the practical meaning of the sentence translation:

taking a scenario related to a product mentioned in the background art, for example, the usage area of a product is converted from area a to area B, and area a uses a first language and area B uses a second language. At this time, it is easy to understand that there is a need to translate the text related to the product, such as the product instruction file (instruction book) and the text appearing in the using process of the product, from the first language to the second language, so as to ensure that the users in the region B can use the product normally.

The product may be an entity, such as an electronic product, or may also be a non-entity, such as a website, and the website may be a web portal or an e-commerce platform, especially a cross-border e-commerce. Taking the cross-border e-commerce platform as an example, in order to enable users corresponding to different languages to know commodity information and a transaction flow on the e-commerce platform and further realize cross-border transaction, the text content contained in the e-commerce platform interface needs to be translated. In practical applications, the text displayed on the interface may include the text shown in fig. 9.

In another man-machine interaction scenario, the default language of the interaction device may be a first language, and after the user sends a voice instruction of a second language to the electronic product, the translation system in the interaction device also needs to translate the voice instruction of the first language into the second language, and further output a response result corresponding to the voice instruction.

In all the above mentioned scenarios, there is a translation requirement, and the translation method provided by the embodiment of the present invention can be used at this time. Of course, the present invention is not limited to the usage scenario, and the translation method provided in the embodiment of the present invention may be used in any scenario where there is a translation requirement.

Based on the above description, some embodiments of the present invention will be described in detail below with reference to the accompanying drawings. And features in the embodiments and examples described below may be combined with each other without conflict between the embodiments. In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.

Fig. 1 is a flowchart of a translation method according to an embodiment of the present invention, where the translation method according to the embodiment of the present invention may be executed by a translation system in a data processing device. It will be appreciated that the data processing apparatus may be implemented as software, or a combination of software and hardware. As shown in fig. 1, the method comprises the steps of:

s101, obtaining a statement to be translated and attribute information of the statement to be translated.

The translation system can acquire the statement to be translated input by the user and acquire the attribute information of the statement to be translated. However, the translation scenes are not used, and the specific content and the acquisition mode of the sentences to be translated and the attribute information are different. The following examples illustrate:

in a translation scene related to a product, a specification of the product, other text contents of the product, or a file describing a transaction flow of an e-commerce platform may be regarded as a file to be translated, where the file corresponding to the e-commerce platform may include text contents displayed on a platform interface. Alternatively, the user may manually write the document to be translated and input it into the translation system. And then, a file analysis module and a sentence dividing module in the translation system divide the file to be translated. Each sentence in the processed file to be translated can be regarded as a sentence to be translated, namely the translation system obtains the sentence to be translated.

Meanwhile, in the process of writing the file to be translated, a user can set attribute information for the file to be translated, and the attribute information of the whole file to be translated is also the attribute information of each statement to be translated in the file to be translated. At this time, the translation system obtains the attribute information of the sentence to be translated.

In the above scenario, the attribute information of the sentence to be translated may include at least one of version information of the file to be translated, an application field of the file to be translated, and product information of a product to which the file to be translated is applicable. The applicable field can be, for example, the field of electronic equipment, the field of mechanical equipment, the field of computers, and the like; the product information may be, for example, the brand, model, etc. of the product.

In a human-computer interaction scenario, the sentence to be translated may be a voice instruction input by a user to a translation system of the interaction device. In a daily home interaction scenario, the voice command input by the user is generally the content of a daily chat, and therefore, in an alternative manner, the interactive device may directly determine the default attribute information of the interactive device as the attribute information of the voice command. At this time, the default attribute information may include an applicable field of the voice command, that is, a daily chat field.

In practical applications, the voice command input by the user may also include some more professional contents, and optionally, before the user inputs the voice command, the user may set the attribute information of the voice command in advance on an operation interface provided by the interactive device. At this time, the attribute information set by the user may also include an applicable field of the voice instruction, and the applicable field may be computer, finance, medicine, or the like.

S102, determining a target statement corresponding to the statement to be translated in the translation memory base according to the attribute information, wherein the attribute information of the target statement is matched with the attribute information of the statement to be translated.

After obtaining the sentence to be translated, the translation system can determine the target sentence with the attribute information matched with the attribute information of the sentence to be translated in the translation memory base. Wherein, the association relation between the original text and the translated text is stored in the translation memory bank. Specifically, a plurality of sentence pairs are stored in the translation memory, each sentence pair is composed of one original sentence and one translated sentence corresponding to the original sentence, and the original sentence and the translated sentence in each sentence pair have the same attribute information.

The matching of the attribute information between the sentence to be translated and the target sentence can be understood as follows: as can be appreciated from the above description, the attribute information may include applicable domain and/or product information. If the application fields corresponding to the two sentences are the same, or the product information of the products suitable for the two sentences is the same, or the application fields and the products are the same, the attribute information of the two sentences can be considered to be matched.

S103, determining that the translation corresponding to the target sentence in the translation memory base is the translation corresponding to the sentence to be translated.

After the target sentence is obtained, the translation system can further determine the translation corresponding to the target sentence according to the association relationship between the original text and the translation stored in the translation memory base. Finally, the translation of the target sentence is also the translation corresponding to the sentence to be translated, thereby completing the whole translation process.

In this embodiment, a sentence to be translated and attribute information of the sentence are obtained. And then determining a target sentence corresponding to the sentence to be translated in the translation memory base according to the attribute information. Further, a translation corresponding to the target sentence is determined from the translation memory, thereby completing the translation. It can be seen that the translation method provided by the embodiment of the present invention is actually: setting attribute information for the sentences to be translated and the sentences in the translation memory library, automatically matching target sentences according to the set attribute information, and further obtaining the translated text. Compared with manual translation, the translation mode of automatic matching through the set attribute information obviously can greatly improve the translation efficiency.

It should be noted that, besides manual Translation, Computer-Aided Translation (CAT) tool may be used to implement auxiliary Translation, so as to improve Translation efficiency to some extent.

In practical application, in order to ensure management of the translation memory, the translation memory is often provided with independent translation memory for different application fields and different product types, so that when a CAT tool is used for assisting translation, a user needs to manually select the translation memory suitable for a sentence to be translated according to the content of the sentence to be translated so as to determine a translation of the sentence to be translated by using the selected translation memory.

However, in the process of using the above manner, on one hand, for each sentence to be translated or the document to be translated to which each sentence to be translated belongs, the user needs to manually select the corresponding translation memory, and this selection operation still causes the translation efficiency to be low. On the other hand, the accuracy of the user selection on the translation memory base directly influences the accuracy of the translation. To ensure the translation is accurate, the user is likely to need to select the translation memory many times to find the accurate memory, which also results in low translation efficiency.

By using the translation method provided by each embodiment of the invention, because each statement in the translation memory bank is provided with the attribute information, the memory bank can be divided according to the application field or the product type, and the translation system can find the target statement matched with the attribute information of the statement to be translated according to the attribute information, thereby avoiding the process of manually selecting the translation memory bank and avoiding the defects.

As mentioned in the foregoing embodiment, the to-be-translated sentence may be a sentence in a to-be-translated file related to a product, and in this scenario, as shown in fig. 2a, a manner of optionally obtaining the to-be-translated sentence and attribute information is also a specific implementation manner of step 101 in the embodiment shown in fig. 1:

and S1011, responding to the uploading operation triggered by the user in the translation system, and acquiring the physical file to be translated.

And S1012, responding to the input operation triggered by the user in the translation system, and acquiring the attribute information of the file to be translated.

And S1013, determining the attribute information of the sentence to be translated according to the attribute information of the file to be translated.

Specifically, a user may first write a file to be translated using a file editing system in the data mathematical device. After the writing of the file to be translated is completed, the user can open the translation system in the data processing device again. The translation system responds to uploading operation triggered by a user in the translation system, and obtains a file to be translated. Meanwhile, the user can set the attribute information of the file to be translated according to the content of the file to be translated in the translation system. The translation system may also obtain attribute information of the file to be translated in response to an input operation triggered by the user. Then, the translation system can further perform clause processing on the obtained file to be translated to obtain a sentence to be translated, wherein the attribute information of the sentence to be translated is also the attribute information of the whole file to be translated.

Optionally, in order to ensure convenience of file management, when the file to be translated is edited by the file editing system, the user also needs to set the attribute information of the file in the file editing system.

In the above manner, the file editing system and the translation system are two independent systems in the data processing device, and data sharing cannot be realized between the two systems, so that a user needs to upload a to-be-translated file containing a to-be-translated sentence to the translation system and then translate the translation system.

In order to further simplify the operation of the user, an Application Programming Interface (API) may be used to communicate between the file editing system and the translation system, so that the two systems may synchronize information. As shown in fig. 2b, another optional manner for acquiring the statement to be translated is that a specific implementation manner of step 101 in the embodiment shown in fig. 1:

s1014, responding to the sending operation triggered by the user in the document editing system, receiving the file to be translated sent by the document editing system.

And S1015, receiving the attribute information of the file to be translated, which is sent by the document editing system, in response to the input operation triggered by the user in the document editing system.

And S1016, determining the attribute information of the sentence to be translated according to the attribute information of the file to be translated.

The user can write the file to be translated in the file editing system, and the translation system and the file editing system can realize information synchronization, so that the user can trigger sending operation in the file editing system after the file is edited, so that the translation system responds to the sending operation, and the file to be translated is obtained.

Meanwhile, the user can trigger input operation in the file editing system so as to set the attribute information of the file to be translated. At this time, the translation system can also synchronously obtain the attribute information of the file to be translated. The translation system can perform sentence division processing on the file to be translated to obtain the sentences to be translated, and further determine the attribute information of the file to be translated as the attribute information of each sentence to be translated.

In this embodiment, after the file editing system and the translation system are put through, the user only needs to edit the file in the file editing system and set the attribute information, and then the contents are synchronized to the translation system. Compared with the process that the user needs to set the attribute information in the two systems respectively and needs to manually upload the file to the translation system in the embodiment shown in fig. 2a, the operation of the user can be greatly facilitated.

As can be seen from the above description, a sentence matching attribute information of a sentence to be translated is determined as a target sentence in the translation memory, but it is easy to understand that a sentence matching at least one attribute information of a sentence to be translated is easily present in the translation memory. At this time, a manner of optionally determining the target sentence is shown in fig. 3a, which is a specific implementation manner of step 102 in the embodiment shown in fig. 1:

s1021, at least one alternative sentence matched with the attribute information of the sentence to be translated is determined in the translation memory base.

S1022, determining semantic similarity between the sentence to be translated and at least one alternative sentence.

And S1023, determining the alternative sentences with the semantic similarity meeting the requirement as target sentences.

Specifically, at least one alternative sentence of which the attribute information matches with the attribute information of the sentence to be translated may be determined in the translation memory. When there is one candidate sentence, the candidate sentence is determined as the target sentence. When a plurality of alternative sentences exist, the matching of the attribute information can only indicate that the applicable fields and/or the product information of the sentences to be translated and the alternative sentences are the same, but cannot reflect whether the semantic levels of the sentences are the same or not. Therefore, the translation system may further calculate semantic similarities between the sentence to be translated and the plurality of candidate sentences, respectively, and optionally, the semantic similarities may be expressed as hamming distances and the like. And finally, determining the alternative sentences the semantic similarity of which meets the requirements as target sentences. Alternatively, the candidate sentence corresponding to the highest semantic similarity may be determined as the target sentence.

The number of translation memory banks is not described in the above manner. In practical application, if all fields and all products are applied to one translation memory library, the contents in the translation memory library are huge, and instead, the target sentence is not easy to be determined quickly. Therefore, independent translation memory banks can be set for different application fields or different product types. Of course, the division granularity of the translation memory can be smaller, for example, different brands of the same product type have independent translation memories respectively, and the like. At this time, another way of optionally determining the target statement is shown in fig. 3b, which is another specific implementation manner of step 102 in the embodiment shown in fig. 1:

s1024, determining at least two alternative memory banks matched with the attribute information of the sentence to be translated from the translation memory banks according to the attribute information of the translation memory banks, wherein the attribute information related to the translation memory banks is the attribute information of the sentence in the translation memory bank.

S1025, determining at least two alternative sentences meeting the requirement of semantic similarity with the sentence to be translated in at least two alternative memory banks.

And S1026, determining the alternative sentence corresponding to the highest weight value as the target sentence according to the weight values of the alternative memory libraries to which the at least two alternative sentences belong respectively.

Specifically, the translation system inputs the sentence to be translated into a plurality of related translation memory banks according to the acquired content of the sentence to be translated, wherein the attribute information of the related translation memory banks is also the attribute information of the sentence stored in the translation memory bank. And then, determining an alternative memory bank with attribute information matched with the attribute information of the sentence to be translated in the plurality of translation memory banks.

If only one alternative memory bank is provided, the target sentence is determined in the alternative memory bank by calculating the semantic similarity between the sentence to be translated and each sentence in the only alternative memory bank.

If the number of the alternative memory banks is at least two, the semantic similarity between the sentence to be translated and each sentence in the at least two alternative memory banks is calculated respectively, so as to determine the alternative sentence with the semantic similarity meeting the requirement in the at least two alternative memory banks. If only one alternative sentence is determined in the at least two alternative memory banks, the alternative sentence is the target sentence. If at least two alternative sentences with semantic similarity meeting the requirement are respectively determined in the at least two alternative memory banks, that is, at least two alternative sentences exist, the alternative sentence corresponding to the highest weight value is determined as the target sentence according to the weight values of the alternative memory banks to which the at least two alternative sentences belong.

For example, if the sentence to be translated is a sentence in a tv profile of a brand M model N3 in the field of home appliances, the sentence is input into a plurality of translation memory banks corresponding to the tv of the brand M, and the translation system can obtain a plurality of candidate memory banks, where the attribute information of the candidate memory bank 1 is the brand M model N1, and the attribute information of the candidate memory bank 2 is the brand M model N2.

Since model N2 is newer than model N1 for the model M television, the weight value of alternative memory pool 2 is higher than that of alternative memory pool 1. Based on the weight value, if the translation system determines that the sentences with semantic similarity meeting the requirement in the alternative memory banks 1 and 2 are the at least two alternative sentences through calculating the semantic similarity. At this time, the candidate sentence in the candidate memory library 1 with a high weight value may be determined as the target sentence.

In summary, the above provides different ways of determining the target sentence. In any way, as long as the translation of the sentence to be translated is stored in the translation memory bank, the target sentence and the translation corresponding to the sentence to be translated can be matched in a certain way through the automatic matching mode, the reuse efficiency of the sentence pair in the translation memory bank is greatly improved, and the situation that the corresponding target sentence and the translation cannot be obtained due to improper manual selection of the translation memory bank in the prior art is avoided. Of course, in practical application, the above-mentioned modes can be selected and used according to actual requirements.

In each of the above embodiments, the target sentence can be found in the translation memory, which is easy to understand, and there may be a case where the target sentence cannot be determined, at this time, fig. 4 is a flowchart of another translation method provided in an embodiment of the present invention, as shown in fig. 4, the method may include the following steps:

s201, obtaining a statement to be translated and attribute information of the statement to be translated.

S202, according to the attribute information, determining whether a target sentence corresponding to the sentence to be translated exists in the translation memory base, wherein the attribute information of the target sentence is matched with the attribute information of the sentence to be translated, if the target sentence exists, executing the step 203, otherwise, executing the steps 204 to 205.

S203, determining the translation corresponding to the target sentence in the translation memory base as the translation corresponding to the sentence to be translated.

The execution process of the steps 201 to 203 is similar to the corresponding steps in the foregoing embodiment, and reference may be made to the related description in the embodiment shown in fig. 1, which is not repeated herein.

And S204, outputting the sentence to be translated for manual translation processing.

S205, acquiring a translation corresponding to the sentence to be translated and input by the user.

If the target sentence corresponding to the sentence to be translated is not found in the translation memory library, the sentence is a brand new sentence and is not recorded in the translation memory library, the translation system outputs the sentence to be translated as it is, so that the sentence is translated manually.

Optionally, after manual translation, the user may also trigger an update operation in the translation system, so that the translation memory updates the association relationship between the sentence to be translated and the translation input by the user. If the translation memory is not updated, if the sentence to be translated appears again in the following process, the corresponding target sentence still cannot be found.

In addition, in practical application, it is easy to understand that even if a target sentence corresponding to a sentence to be translated is determined, the translation of the target sentence is not necessarily accurate or does not meet the requirement of a user. At this time, optionally, after step 203, the translation method may further include:

and S207, responding to the modification operation triggered by the user on the translation, and acquiring the modified translation.

S208, storing the association relationship between the statement to be translated and the modified translation into a translation memory bank.

After determining the translation of the sentence to be translated, the translation system may present it to the user. If the user is not satisfied with the translated text, the modification operation can be triggered on an operation interface provided by the translation system so as to manually modify the translated text. Further, the translation system may obtain the modified translation, and store the sentence to be translated and the association between the modified translation to the translation memory. And the modified translation is automatically set with the attribute information same as the to-be-translated sentence by the translation system. And the sentence to be translated and the modified translation can form a new sentence pair, and the translation system can set new version information for the new sentence pair while storing.

For example, after obtaining a sentence to be translated, the translation system may first query a sentence pair including a target sentence in the translation memory, where the sentence pair further includes a translation 1 corresponding to the target sentence, and attribute information of each of the target sentence and the translation 1 includes the applicable field, product information, and version information of both may be represented as V1. At this point, the translation system may present translation 1 to the user. If the user is not satisfied with the translation 1, the user can modify the translation to obtain the translation 2, and the translation system stores the association relationship between the sentence to be translated and the translation 2. That is, a new sentence pair consisting of the sentence to be translated and the translation 2 is updated into the translation memory, and the version information in the attribute information of both is V2. Fig. 5 is a schematic interface diagram of the translation system showing the translation result, and as shown in fig. 5, if the target sentence corresponding to the to-be-translated sentence with sequence number 3 is not found in the translation memory, one place of the "translated sentence" is empty.

It should be noted that, based on the above description, as the contents in the translation memory are gradually increased, there may exist multiple versions of translations for the same sentence to be translated. In practical application, the translation system determines a plurality of sentences matched with the attribute information of the sentence to be translated, each sentence corresponds to a translation with different versions,

the translation system finally displays the translation of the latest version in the first preset position of the operation interface, such as the interface important. Meanwhile, for translations of other versions, the translations can also be displayed on a second preset position of the operation interface, such as one side of the interface. The translation system can also determine the translation selected by the user as the translation corresponding to the sentence to be translated by responding to the selection operation of the user on the translations of other versions. Fig. 6 is a schematic interface diagram of another translation result, which can be understood in conjunction with fig. 6.

In this embodiment, if the target sentence corresponding to the sentence to be translated exists in the translation memory, the translation system may directly output the translated sentence, thereby completing the translation process. The automatic translation mode can greatly improve the translation efficiency, can also greatly improve the reuse efficiency of statement pairs in the translation memory bank, and can not cause the situation that corresponding target statements and translations cannot be obtained due to improper manual selection of the translation memory bank in the prior art. If the target sentence does not exist in the translation memory base, the traditional manual translation mode can be adopted to ensure the translation quality, and the translated text of the manual translation can be automatically associated with the attribute information and stored in the corresponding translation memory base.

The translation device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these translation devices may each be constructed using commercially available hardware components configured through the steps taught by the present solution.

Fig. 7 is a schematic structural diagram of a translation apparatus according to an embodiment of the present invention, and as shown in fig. 7, the translation apparatus includes:

the first obtaining module 11 is configured to obtain a statement to be translated and attribute information of the statement to be translated.

A first determining module 12, configured to determine, according to the attribute information, a target sentence corresponding to the sentence to be translated in a translation memory, where the attribute information of the target sentence is matched with the attribute information of the sentence to be translated.

A second determining module 13, configured to determine that the translation corresponding to the target sentence in the translation memory is the translation corresponding to the sentence to be translated.

Optionally, the first obtaining module 11 is specifically configured to: acquiring a file to be translated and attribute information of the file to be translated; performing sentence division processing on the file to be translated to obtain the sentence to be translated; determining the attribute information of the file to be translated as the attribute information of the sentence to be translated;

wherein the attribute information includes: at least one item of version information of the file to be translated, the applicable field of the translated file and product information of an applicable product;

wherein the matching of the attribute information of the target statement and the attribute information of the statement to be translated comprises: and the application field and/or the product information of the applicable product corresponding to the sentence to be translated and the target sentence are the same.

Optionally, the first determining module 12 is specifically configured to: determining at least one alternative sentence matched with the attribute information of the sentence to be translated in the translation memory base; determining semantic similarity between the sentence to be translated and the at least one alternative sentence; and determining the candidate sentences the semantic similarity of which meets the requirement as the target sentences.

Optionally, the translation memory is multiple;

the first determining module 12 is specifically configured to: determining at least two alternative memory banks matched with the attribute information of the statement to be translated from the translation memory banks according to the respective attribute information of the translation memory banks, wherein the attribute information associated with the translation memory banks is the attribute information of the statement in the translation memory banks; determining at least two alternative sentences meeting the requirement of semantic similarity with the sentence to be translated in the at least two alternative memory libraries; and determining the alternative sentence corresponding to the highest weight value as the target sentence according to the weight value of the alternative memory base to which the at least two alternative sentences belong respectively.

Optionally, the apparatus further comprises:

the second obtaining module 21 is further configured to, in response to a modification operation triggered by the user on the translation, obtain the modified translation.

And the storage module 22 is configured to store the association relationship between the sentence to be translated and the modified translation into the translation memory.

Optionally, the apparatus further comprises:

and the output module 23 is configured to output the sentence to be translated for manual translation processing if the target sentence corresponding to the sentence to be translated does not exist in the translation memory.

The second obtaining module 21 obtains a translation corresponding to the sentence to be translated, which is input by the user.

Optionally, the saving module 22 is further configured to, in response to an update operation triggered by the user, save the association relationship between the sentence to be translated and the translation input by the user to the translation memory.

Optionally, the first obtaining module 11 is specifically configured to: responding to a sending operation triggered by the user in a document editing system, and receiving the file to be translated sent by the document editing system; responding to an input operation triggered by a user in a document editing system, and receiving attribute information of the file to be translated sent by the document editing system; and determining the attribute information of the statement to be translated according to the attribute information of the file to be translated.

The apparatus shown in fig. 7 can perform the method of the embodiment shown in fig. 1 to 6, and reference may be made to the related description of the embodiment shown in fig. 1 to 6 for a part not described in detail in this embodiment. The implementation process and technical effect of the technical solution refer to the descriptions in the embodiments shown in fig. 1 to fig. 6, and are not described herein again.

The internal functions and structures of the translation apparatus are described above, and in one possible design, the structure of the translation apparatus may be implemented as an electronic device, as shown in fig. 8, which may include: a processor 31 and a memory 32. Wherein the memory 32 is used for storing a program that supports the electronic device to execute the translation method provided in the embodiments shown in fig. 1 to fig. 6, and the processor 31 is configured to execute the program stored in the memory 32.

The program comprises one or more computer instructions which, when executed by the processor 31, are capable of performing the steps of:

acquiring a statement to be translated and attribute information of the statement to be translated;

determining a target statement corresponding to the statement to be translated in a translation memory according to the attribute information, wherein the attribute information of the target statement is matched with the attribute information of the statement to be translated;

and determining the translation corresponding to the target sentence in the translation memory base as the translation corresponding to the sentence to be translated.

Optionally, the processor 31 is further configured to perform all or part of the steps in the foregoing embodiments shown in fig. 1 to 6.

The electronic device may further include a communication interface 33 for communicating with other devices or a communication network.

In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for the electronic device, which includes a program for executing the translation method in the method embodiments shown in fig. 1 to fig. 6.

For understanding, a specific implementation process of the translation method provided above is exemplarily described in conjunction with an application scenario of an e-commerce platform as follows.

The user can write a specification file about the e-commerce platform M1 in the file editing system of the data processing device, and the file may include fields displayed on each page in the e-commerce platform M1, and the specific fields may be as shown in fig. 9. The description file is the file to be translated in the above embodiments, and each field in the file is the sentence to be translated in the above embodiments.

In the process of writing, a user can also select attribute information of a file on an operation interface of the file editing system, wherein the attribute information of the file comprises the following steps: the system is suitable for the E-commerce field, the product information is an E-commerce platform M1, and the version information is V1.

Because the translation system in the data processing device is already communicated with the file editing system and the translation system and the file editing system can share information, the translation system can directly acquire the description file and the attribute information of the description file at the moment. The translation system can analyze and sentence-divide the acquired description file to obtain each sentence in the description file, namely the sentence to be translated. And the attribute information of the whole specification file set by the user is also the attribute information of each statement to be translated. Alternatively, the translation system and the file editing system may not be opened, and the user is required to manually upload the description file and the attribute information thereof in the translation system.

The translation system may include a plurality of translation memory banks, such as memory bank 1 corresponding to the e-commerce platform M1, memory bank 2 corresponding to the e-commerce platform M2, memory bank 3 corresponding to the e-commerce platform M3, and memory bank 4 corresponding to the web portal P. Therefore, after obtaining the sentence to be translated, the translation system can input the sentence to be translated to a plurality of translation memory banks respectively, and determine whether an alternative memory bank matched with the attribute information of the sentence to be translated exists.

The matching of the attribute information shows that the alternative memory banks and the statements to be translated are applicable to the same field, so that the alternative memory banks are the memory banks 1-3. Moreover, the type of M2 is closer to M1 than M3, so the weight values of the memory banks 1-4 are sequentially reduced.

Further, the translation system determines whether an alternative statement matched with the attribute information of the statement to be translated exists in the memory libraries 1-3. Because the attribute information of the statement to be translated is the same as that of the alternative memory library, the statements in the memory libraries 1-3 can be considered as alternative statements. At this time, the translation system needs to further calculate the semantic similarity between the sentence to be translated and the candidate sentence, and determine the candidate sentence with the semantic similarity meeting the condition as the target sentence, for example, determine the candidate sentence with the highest semantic similarity as the target sentence.

And if a plurality of alternative sentences in the memory banks 1-3 with the semantic similarity meeting the requirement exist, determining the alternative sentences in the memory bank 1 with the highest weight value as target sentences. If a plurality of alternative sentences exist in the memory base 1, the translation system calculates semantic similarity between the alternative sentences and the sentence to be translated, and determines the alternative sentence with the highest semantic similarity as the target sentence.

After the target sentence is determined through the above process, the translation system can determine the translation corresponding to the target sentence as the translation of the sentence to be translated, and display the translation to the user. If the user is not satisfied with the translation, further modifications may be made and the translation system may save it. At this time, the to-be-translated sentence and the modified translation have the attribute information: the system is suitable for the E-commerce field, the product information is an E-commerce platform M1, and the version information is V2.

In addition, in practical applications, there are also situations where the translation system cannot determine the translated sentence, and at this time, the translation system may display the sentence to be translated as it is, so that the user may manually input the translated sentence. The translation system stores the sentence to be translated and the translation input by the user.

After all fields in the E-commerce platform M1 interface are translated, users of different languages can use the website, and the use range of the website is expanded.

The translation method provided above can also be used in the translation scenario of a product specification. Specifically, the file to be translated may be a specification of a television with a brand X and a model X, and each sentence in the specification may be a sentence to be translated. At this time, the translation system performs sentence division processing on the acquired file to be translated to obtain at least one sentence to be translated. For each statement to be translated, the translation system may translate according to the translation method provided in the embodiments shown in fig. 1 to 6. Thereby finally obtaining the translated specification.

In addition, the specific implementation process of the translation method provided above can be exemplarily described in combination with a human-computer interaction scenario.

An interactive device such as an intelligent robot is generally used by a chinese user, and when another user who uses english issues a voice command, a translation system in the intelligent robot receives the english voice command and inputs the voice command to the translation system. So that the translation system can determine the target sentence matched with the attribute information of the input voice command in the translation memory. And further obtaining a translation corresponding to the target statement. At this time, the attribute information of the voice command may include a default daily chat domain of the intelligent robot. Optionally, the user who issues the voice command may also set attribute information of the voice command on an interactive interface provided by the intelligent robot.

For the process of determining the target statement, reference may be made to the related description in the embodiments shown in fig. 1 to 6, which is not described herein again. Then, the intelligent robot searches in a search engine matched with the intelligent robot according to the translation determined by the translation system and outputs a search result, so that man-machine interaction is completed.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电子邮件的翻译方法、装置和计算机设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!