Document translation method and device

By matching and replacing the content of the document to be translated with the corpus in the corpus, the problem of inaccurate translation of the translation software in the existing technology is solved, efficient automatic document translation is achieved, and the work efficiency of the translator is improved.

CN112597779BActive Publication Date: 2024-10-01IOL WUHAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011552157.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2024-10-01
Estimated Expiration
2040-12-24

AI Technical Summary

Technical Problem

It is difficult for existing translation software to accurately translate document content, requiring translators to translate manually, which is inefficient.

Method used

By matching the content of the document to be translated with the corpus in the corpus, and using the matched corpus to replace and restore, automatic translation is achieved and translation efficiency is improved.

Benefits of technology

It improves the work efficiency of translators, reduces the time and energy of manual translation, and makes full use of the corpus for automatic translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597779B_ABST
    Figure CN112597779B_ABST
Patent Text Reader

Abstract

The present invention provides a document translation method and device, the method comprising: for any content in a document to be translated, matching the content with a corpus in a corpus; wherein the language of the document to be translated is the same as the language of the corpus; if a corpus identical to the content is matched, replacing the words in the content according to the different words between the matched corpus and the content; if a corpus identical to the replaced content is matched from the corpus, obtaining a translation result of the matched corpus from the corpus; according to the replaced words in the content, restoring the replaced words in the translation result, and using the translation result after the corpus restoration as the translation result of the content. This implementation uses a corpus to automatically translate document content, thereby improving translation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of language translation, and in particular to a document translation method and device. Background Art

[0002] Document translation refers to translating the content in a document into a desired language. Various translation software are available in the prior art that can translate input content into a specified language.

[0003] Although translation software is efficient, each language has specific sentence structures, and each word has different meanings in different scenarios, making it difficult for translation software to accurately translate document content.

[0004] Since translation software is not accurate, translators are often required to translate the document content manually. Although the accuracy of translators' translations is much higher than that of translation software, it is less efficient and time-consuming. Summary of the invention

[0005] The present invention provides a document translation method and device, which are used to solve the defects in the prior art that translators manually translate document contents, which is time-consuming and laborious, and realize the use of a corpus to assist translators in translation, thereby greatly improving the efficiency of translators.

[0006] The present invention provides a document translation method, comprising:

[0007] For any content in the document to be translated, the content is matched with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus;

[0008] If the corpus that is partially identical to the content is matched, the words in the content are replaced based on the different words between the matched corpus and the content;

[0009] If a corpus that is completely identical to the replaced content is matched from the corpus, a translation result of the matched corpus is obtained from the corpus;

[0010] According to the replaced words in the content, the replaced words in the translation result are restored, and the translation result after the restoration of the corpus is used as the translation result of the content.

[0011] According to a document translation method provided by the present invention, replacing words in the content according to different words between the matched corpus and the content includes:

[0012] If the different words between the matched corpus and the content are preset non-translation words, then the preset non-translation words in the content are replaced with the preset non-translation words in the matched corpus;

[0013] Accordingly, the step of restoring the replaced words in the translation result according to the replaced words in the content includes:

[0014] The preset non-translated words in the translation result are restored to the preset non-translated words replaced in the content.

[0015] According to a document translation method provided by the present invention, replacing words in the content according to different words between the matched corpus and the content includes:

[0016] If the different words between the matched corpus and the content are preset replacement words, the preset replacement words in the content are replaced with the preset replacement words in the matched corpus;

[0017] Accordingly, the step of restoring the replaced words in the translation result according to the replaced words in the content includes:

[0018] The translation result of the preset replacement word in the translation result is restored to the translation result of the preset replacement word replaced in the content obtained in advance.

[0019] A document translation method provided by the present invention further includes:

[0020] If no corpus that is completely identical to the replaced content is matched, the content is split according to preset punctuation marks in the content to obtain multiple segments of the content;

[0021] Each segment of the content is matched with the corpus in the corpus. If the corpus that is exactly the same as each segment is matched, the translation results of the corpus that is exactly the same as each segment are combined in the order of each segment to obtain the translation result of the content.

[0022] According to a document translation method provided by the present invention, the translation result after restoring the corpus as the translation result of the content includes:

[0023] Get all the locations where the content appears in the document;

[0024] The translation result of the restored corpus is used as the translation result of the content at all the positions.

[0025] According to a document translation method provided by the present invention, for any content in a document to be translated, matching the content with corpus in a corpus includes:

[0026] For any content in the document to be translated, determine whether all words in the content are preset non-translation words;

[0027] If they are not all preset non-translation words, the content will be matched with the corpus in the corpus.

[0028] The present invention also provides a document translation device, comprising:

[0029] A first matching module is used to match any content in the document to be translated with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus;

[0030] A processing module, for replacing words in the content according to the different words between the matched corpus and the content if the corpus that is identical to the content is matched;

[0031] A second matching module is used for obtaining a translation result of the matched corpus from the corpus if a corpus that is completely identical to the replaced content is matched from the corpus;

[0032] The restoration module is used to restore the replaced words in the translation result according to the replaced words in the content, and use the translation result after the restoration of the corpus as the translation result of the content.

[0033] A document translation device according to the present invention further includes a splitting module, which is used to:

[0034] If no corpus that is completely identical to the replaced content is matched, the content is split according to preset punctuation marks in the content to obtain multiple segments of the content;

[0035] Each segment of the content is matched with the corpus in the corpus. If the corpus that is exactly the same as each segment is matched, the translation results of the corpus that is exactly the same as each segment are combined in the order of each segment to obtain the translation result of the content.

[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned document translation methods when executing the computer program.

[0037] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned document translation methods are implemented.

[0038] The document translation method and device provided by the present invention match any content in the document to be translated with the corpus in the corpus. When there is no complete match but a partial match, the content is processed so that the replaced content completely matches the corpus, and the translation result of the completely matched corpus is restored to obtain the translation result of the content, so that the corpus is fully utilized to automatically translate the content of the document to be translated, thereby improving the translation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 This is one of the flowcharts of the document translation method provided by the present invention;

[0041] Figure 2 This is the second flow chart of the document translation method provided by the present invention;

[0042] Figure 3 This is the third flow chart of the document translation method provided by the present invention;

[0043] Figure 4 It is a structural schematic diagram of the document translation device provided by the present invention;

[0044] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Combine the following Figure 1 The document translation method of the present invention is described, and the method comprises: step 101, for any content in the document to be translated, matching the content with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus;

[0047] The document to be translated is a document that needs to be translated. The format of the document to be translated can be PDF or Word, etc., and this embodiment does not limit the format of the document. The language of the document can be Chinese, English, etc., and this embodiment does not limit the language of the document. The content in the document can be a sentence or paragraph in the document, but this embodiment is not limited to this division.

[0048] The corpus stores a large amount of corpora and translation results of the corpora. The language of the corpora is the same as the language of the document to be translated. Since there are many platforms for translation and a large amount of corpora have been accumulated, in order to reasonably, conveniently and quickly assist translators in translation, this embodiment matches the content of the document to be translated with the corpus by calculating the similarity between the content in the document to be translated and the corpus in the corpus.

[0049] Before translating the document to be translated, determine whether the document to be translated has been translated. The translated document is encrypted by the MD5 (Message-Digest) algorithm and saved in the cache. Therefore, the cache is checked to see if the document to be translated exists. If it exists, there is no need to translate the document to be translated again; if it does not exist, the subsequent translation steps are carried out.

[0050] Step 102, if a corpus that is partially identical to the content is matched, then the words in the content are replaced according to the different words between the matched corpus and the content;

[0051] The corpus with similarity greater than the preset threshold is used as the corpus matching the content. The matching corpus is divided into complete match and partial match. It is judged whether each corpus matching the content is exactly the same as the content, that is, the similarity is 100%. If there is a corpus that is exactly the same as the content, the translation result of the corpus is directly used as the translation result of the content, and no translator is required to translate it.

[0052] If a corpus with a similarity greater than a preset threshold exists, but the similarity is not 100%, it means that a corpus that is partially identical to the content exists. Each corpus that is partially identical is compared with the content, and the words in the content are replaced with words in each corpus that are different from the content.

[0053] Step 103: if a corpus that is completely identical to the replaced content is matched from the corpus, a translation result of the matched corpus is obtained from the corpus;

[0054] The replaced content is matched again with the corpus in the corpus, that is, the similarity between each corpus in the corpus and the replaced content is calculated. If the two are completely matched, the translation result of the replaced content is obtained from the corpus.

[0055] Step 104: According to the words replaced in this content, restore the replaced words in the translation result, and use the restored translation result of the corpus as the translation result of this content.

[0056] To obtain the translation result of this content before replacement, it is necessary to restore the replaced words in the translation result of this content after replacement. For example, the existing corpus content is "Hello world", and the translation is "你好,世界". Now it is necessary to translate "Hello today", which cannot be directly matched from the corpus. Replace "today" in "Hello today" with "world" and then perform the matching. After obtaining the translation result "你好,世界" of "Hello world", restore it. When restoring, it is necessary to know the translations of "world" and "today". The specific process is as Figure 2 shown.

[0057] In this embodiment, any content in the document to be translated is matched with the corpus in the corpus. When there is no exact match and there is a partial match, the content is processed so that the replaced content completely matches the corpus, and the translation result of the completely matched corpus is restored to obtain the translation result of this content, making full use of the corpus to automatically translate the content of the document to be translated and improving the translation efficiency.

[0058] Based on the above embodiment, in this embodiment, replacing the words in this content according to the different words between the matched corpus and this content includes: if the different words between the matched corpus and this content are preset non-translatable words, then replace the preset non-translatable words in this content with the preset non-translatable words in the matched corpus;

[0059] Specifically, the different words between the matched corpus and this content in this embodiment are preset non-translatable words. Preset non-translatable words are words that are preset not to be translated, such as foreign names. Replace the preset non-translatable words in this content so that the replaced content completely matches the partially matched corpus.

[0060] Correspondingly, restoring the replaced words in the translation result according to the words replaced in this content includes: restoring the preset non-translatable words in the translation result to the preset non-translatable words replaced in this content.

[0061] To achieve a complete match, the preset non-translatable words in this content are replaced, and preset non-translatable words do not need to be translated. Therefore, after obtaining the translation result of this content after replacement, restore the replaced preset non-translatable words in the translation result to the preset non-translatable words before replacement.

[0062] Based on the above embodiment, the method of replacing words in the content according to the different words between the matched corpus and the content in this embodiment includes: if the different words between the matched corpus and the content are preset replacement words, replacing the preset replacement words in the content with the preset replacement words in the matched corpus;

[0063] Specifically, in this embodiment, the different words between the matched corpus and the content are preset replacement words. The preset replacement words are words that can be replaced by words in a preset sentence. The preset replacement words in the content are replaced so that the replaced content completely matches the partially matched corpus.

[0064] Correspondingly, the restoring of the replaced word in the translation result according to the replaced word in the content includes: restoring the translation result of the preset replacement word in the translation result to the pre-acquired translation result of the preset replacement word replaced in the content.

[0065] In order to achieve a complete match, the preset replacement word in the content is replaced, and the translation result of the preset replacement word is predetermined. Therefore, after obtaining the translation result after the content is replaced, the translation of the preset replacement word in the translation result is restored to the translation of the preset replacement word before the replacement.

[0066] On the basis of the above embodiments, this embodiment also includes: if no corpus that is completely identical to the content after replacement is matched, the content is split according to preset punctuation marks in the content to obtain multiple segments of the content; each segment of the content is matched with the corpus in the corpus, and if the corpus that is completely identical to each segment is matched, the translation results of the corpus that is completely identical to each segment in the corpus are combined in the order of each segment to obtain the translation result of the content.

[0067] Specifically, if the corpus does not match the content after replacement, it may be that the order of the sentences is different. Therefore, the content is divided into multiple segments according to specific punctuation marks in the content, such as commas. Each segment is matched with the corpus in the corpus. If the corpus is exactly the same, the order of the translation results of the matched corpus is restored to obtain the translation result of the content.

[0068] On the basis of the above embodiments, the method of using the translation result after the corpus is restored as the translation result of the content in this embodiment includes: obtaining all positions where the content appears in the document; and using the translation result of the restored corpus as the translation result of the content at all positions.

[0069] Specifically, there may be repeated content in the document, and the repeated content is marked, so that the translator does not need to translate it repeatedly. If the content matched to obtain the translation result is repeated in the document, the obtained translation result is used as the translation result of the content at all repeated positions.

[0070] On the basis of the above embodiments, the present embodiment describes matching any content in a document to be translated with the corpus in the corpus, including: for any content in a document to be translated, determining whether all words in the content are preset non-translation words; if not all words are preset non-translation words, matching the content with the corpus in the corpus.

[0071] Specifically, before matching the content in the document to be translated with the corpus in the corpus, it is first determined whether all the words in the content are preset non-translation words. Since the preset non-translation words do not need to be translated, there is no need to translate the content, and no need to match. The complete flow chart is as follows Figure 3 shown.

[0072] The document translation device provided by the present invention is described below. The document translation device described below and the document translation method described above can be referred to each other.

[0073] like Figure 4 As shown, the device includes a first matching module 401, a processing module 402, a second matching module 403 and a restoration module 404, wherein:

[0074] The first matching module 401 is used to match any content in the document to be translated with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus;

[0075] The corpus stores a large amount of corpora and translation results of the corpora. The language of the corpora is the same as the language of the document to be translated. Since there are many platforms for translation and a large amount of corpora have been accumulated, in order to reasonably, conveniently and quickly assist translators in translation, this embodiment matches the content of the document to be translated with the corpus by calculating the similarity between the content in the document to be translated and the corpus in the corpus.

[0076] The processing module 402 is used to replace the words in the content according to the different words between the matched corpus and the content if the corpus that is identical to the content part is matched;

[0077] The corpus with similarity greater than the preset threshold is used as the corpus matching the content. The matching corpus is divided into complete match and partial match. It is judged whether each corpus matching the content is exactly the same as the content, that is, the similarity is 100%. If there is a corpus that is exactly the same as the content, the translation result of the corpus is directly used as the translation result of the content, and no translator is required to translate it.

[0078] If a corpus with a similarity greater than a preset threshold exists, but the similarity is not 100%, it means that a corpus that is partially identical to the content exists. Each corpus that is partially identical is compared with the content, and the words in the content are replaced with words in each corpus that are different from the content.

[0079] The second matching module 403 is used for obtaining the translation result of the matched corpus from the corpus if a corpus that is completely identical to the replaced content is matched from the corpus;

[0080] The replaced content is matched again with the corpus in the corpus, that is, the similarity between each corpus in the corpus and the replaced content is calculated. If the two are completely matched, the translation result of the replaced content is obtained from the corpus.

[0081] The restoration module 404 is used to restore the replaced words in the translation result according to the replaced words in the content, and use the translation result after the restoration of the corpus as the translation result of the content.

[0082] In order to obtain the translation result before the content is replaced, it is necessary to restore the replaced words in the translation result after the content is replaced.

[0083] This embodiment matches any content in the document to be translated with the corpus in the corpus. When there is no complete match but a partial match, the content is processed so that the replaced content completely matches the corpus, and the translation result of the completely matched corpus is restored to obtain the translation result of the content, thereby fully utilizing the corpus to automatically translate the content of the document to be translated, thereby improving translation efficiency.

[0084] On the basis of the above embodiment, in this embodiment, the processing module is used for: if the different words between the matching corpus and the content are preset non-translated words, then the preset non-translated words in the content are replaced with the preset non-translated words in the matching corpus; correspondingly, the restoration module is used for: restoring the preset non-translated words in the translation result to the preset non-translated words replaced in the content.

[0085] On the basis of the above-mentioned embodiment, in this embodiment, the processing module is used for: if the different words between the matched corpus and the content are preset replacement words, then the preset replacement words in the content are replaced with the preset replacement words in the matched corpus; correspondingly, the restoration module is used for: restoring the translation result of the preset replacement word in the translation result to the translation result of the preset replacement word replaced in the content obtained in advance.

[0086] On the basis of the above embodiments, this embodiment also includes a splitting module, which is used to: if no corpus that is completely identical to the content after replacement is matched, split the content according to preset punctuation marks in the content to obtain multiple segments of the content; match each segment of the content with the corpus in the corpus, and if the corpus that is completely identical to each segment is matched, combine the translation results of the corpus that is completely identical to each segment in the corpus according to the order of each segment to obtain the translation result of the content.

[0087] On the basis of the above embodiments, the restoration module in this embodiment is used to: obtain all positions where the content appears in the document; and use the translation results of the restored corpus as the translation results of the content at all positions.

[0088] On the basis of the above embodiments, the first matching module in this embodiment is used to: for any content in the document to be translated, determine whether all the words in the content are preset non-translation words; if not all of them are preset non-translation words, match the content with the corpus in the corpus.

[0089] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the document translation method, which includes: for any content in the document to be translated, the content is matched with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus; if the corpus that is the same as the content part is matched, then the words in the content are replaced according to the different words between the matched corpus and the content; if the corpus that is exactly the same as the replaced content is matched from the corpus, then the translation result of the matched corpus is obtained from the corpus; according to the words replaced in the content, the replaced words in the translation result are restored, and the translation result after the corpus restoration is used as the translation result of the content.

[0090] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0091] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the document translation method provided by the above methods, and the method includes: for any content in a document to be translated, matching the content with a corpus in a corpus; wherein the language of the document to be translated is the same as the language of the corpus; if a corpus that is partially identical to the content is matched, replacing the words in the content according to the different words between the matched corpus and the content; if a corpus that is exactly the same as the replaced content is matched from the corpus, obtaining a translation result of the matched corpus from the corpus; and restoring the replaced words in the translation result according to the replaced words in the content, and using the translation result after the restoration of the corpus as the translation result of the content.

[0092] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the document translation method provided above, the method comprising: for any content in the document to be translated, matching the content with a corpus in a corpus; wherein the language of the document to be translated is the same as the language of the corpus; if a corpus identical to part of the content is matched, replacing the words in the content according to the different words between the matched corpus and the content; if a corpus identical to the replaced content is matched from the corpus, obtaining a translation result of the matched corpus from the corpus; and restoring the replaced words in the translation result according to the replaced words in the content, and using the translation result after the restoration of the corpus as the translation result of the content.

[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A document translation method, characterized in that: include: For any content in the document to be translated, the content is matched with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus; If the corpus that is partially identical to the content is matched, the words in the content are replaced based on the different words between the matched corpus and the content; If a corpus that is completely identical to the replaced content is matched from the corpus, a translation result of the matched corpus is obtained from the corpus; According to the replaced words in the content, the replaced words in the translation result are restored, and the translation result after the restoration of the corpus is used as the translation result of the content; The method further comprises: Before translating the document to be translated, determining whether the document to be translated has been translated; Determining whether the document to be translated needs to be translated based on whether the document to be translated has been translated; The replacing words in the content according to the different words between the matched corpus and the content includes: If the different words between the matched corpus and the content are preset non-translation words, then the preset non-translation words in the content are replaced with the preset non-translation words in the matched corpus; Accordingly, the step of restoring the replaced words in the translation result according to the replaced words in the content includes: Restoring the preset non-translated words in the translation result to the preset non-translated words to be replaced in the content; The replacing words in the content according to the different words between the matched corpus and the content includes: If the different words between the matched corpus and the content are preset replacement words, the preset replacement words in the content are replaced with the preset replacement words in the matched corpus; Accordingly, the step of restoring the replaced words in the translation result according to the replaced words in the content includes: The translation result of the preset replacement word in the translation result is restored to the translation result of the preset replacement word replaced in the content obtained in advance.

2. The document translation method according to claim 1, characterized in that: Also includes: If no corpus that is completely identical to the replaced content is matched, the content is split according to preset punctuation marks in the content to obtain multiple segments of the content; Each segment of the content is matched with the corpus in the corpus. If the corpus that is exactly the same as each segment is matched, the translation results of the corpus that is exactly the same as each segment are combined in the order of each segment to obtain the translation result of the content.

3. The document translation method according to claim 1, characterized in that: The translation result after restoring the corpus as the translation result of the content includes: Get all the locations where the content appears in the document; The translation result of the restored corpus is used as the translation result of the content at all the positions.

4. The document translation method according to claim 1, characterized in that: For any content in the document to be translated, matching the content with the corpus in the corpus includes: For any content in the document to be translated, determine whether all words in the content are preset non-translation words; If they are not all preset non-translation words, the content will be matched with the corpus in the corpus.

5. A document translation device, characterized in that: include: A first matching module is used to match any content in the document to be translated with the corpus in the corpus; wherein the language of the document to be translated is the same as the language of the corpus; A processing module, for replacing words in the content according to the different words between the matched corpus and the content if the corpus that is identical to the content is matched; A second matching module is used for obtaining a translation result of the matched corpus from the corpus if a corpus that is completely identical to the replaced content is matched from the corpus; A restoration module, used for restoring the replaced words in the translation result according to the replaced words in the content, and using the translation result after the restoration of the corpus as the translation result of the content; The first matching module is also used for: Before translating the document to be translated, determining whether the document to be translated has been translated; Determining whether the document to be translated needs to be translated based on whether the document to be translated has been translated; The processing module is specifically used for: If the different words between the matched corpus and the content are preset non-translation words, then the preset non-translation words in the content are replaced with the preset non-translation words in the matched corpus; Accordingly, the restoration module is specifically used for: Restoring the preset non-translated words in the translation result to the preset non-translated words to be replaced in the content; The processing module is specifically used for: If the different words between the matched corpus and the content are preset replacement words, the preset replacement words in the content are replaced with the preset replacement words in the matched corpus; Accordingly, the restoration module is specifically used for: The translation result of the preset replacement word in the translation result is restored to the translation result of the preset replacement word replaced in the content obtained in advance.

6. The document translation device according to claim 5, characterized in that: Also includes split modules for: If no corpus that is completely identical to the replaced content is matched, the content is split according to preset punctuation marks in the content to obtain multiple segments of the content; Each segment of the content is matched with the corpus in the corpus. If the corpus that is exactly the same as each segment is matched, the translation results of the corpus that is exactly the same as each segment are combined in the order of each segment to obtain the translation result of the content.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the document translation method according to any one of claims 1 to 4 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the document translation method according to any one of claims 1 to 4 are implemented.