Method and system for real-time reliability inspection of text translation software based on word closure

Through the method based on the fine-grained transformation relationship and semantic word vector of word closure, instant reliability checking is carried out on the translation results of text translation software, which solves the problem that the reliability of translation results cannot be effectively detected in the prior art, and realizes accurate error detection and positioning in the case of unknown correct translation results.

CN119248540BActive Publication Date: 2025-03-25WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411724743.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-25
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The prior art cannot effectively ensure the correctness and reliability of the translation results returned by text translation software, especially when the correct translation results are unknown, users cannot check the reliability of the translation results instantly.

Method used

A fine-grained transformation relationship based on word closures is adopted, and text transformation operations are performed on the translated text, word alignment relationship between the text to be translated before and after the transformation is constructed, and semantic measurement checks are performed based on the semantic word vector to locate the word closure where the wrong translation is located.

Benefits of technology

It realizes that the reliability of the text translation software returns the translation results without the need to obtain reference translation results in advance, and adapts to multiple input transformation methods to accurately locate the wrongly translated text, which improves the reliability detection ability of the translation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248540B_ABST
    Figure CN119248540B_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for checking the reliability of text translation software based on word closure. The method includes: collecting the currently input text to be translated, performing text transformation operation on the currently input text to be translated to obtain the transformed text to be translated, and constructing the word alignment relationship between the text to be translated before and after the transformation; collecting the translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, constructing the word alignment relationship between the currently input text to be translated and its corresponding translation result and the word alignment relationship between the transformed text to be translated and its corresponding translation result; constructing the word closure unit between the text to be translated before and after the transformation and the translation result of the text translation software; based on the semantic word vector, performing semantic measurement inspection on the translation text matched inside each word closure unit, locating the word closure where the wrong translation is located; summarizing and displaying the inspection results, and reporting the reliability measurement situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an instant reliability check of a translation result returned by a text translation software, and specifically to an instant reliability check method and system for text translation software based on word closure. Background Art

[0002] With the continuous development of deep learning technology in recent years, text-oriented machine translation software has been increasingly widely used in people's daily lives, providing great convenience for people to read and understand texts in different languages. When using text translation software, the user inputs a piece of original language text into the text translation software and selects the target language for the intended translation. The text translation software understands and processes the input text and returns the translation result in the target language to the user. Since text translation software can help users without relevant language backgrounds quickly translate texts, thus facilitating people's lives and work, more and more text translation software and automatic translation services are being developed and provided.

[0003] As a software based on artificial intelligence and deep learning technology, it is limited by the black box properties of neural networks. Current technology cannot ensure the correctness and reliability of the translation results returned by text translation software from a technical level. At present, the method of verifying the translation results returned by text translation software is usually to compare the translated text of the software with the standard answers that have been manually pre-marked. However, pre-marking reference translations for evaluation and comparison is time-consuming and laborious. In addition, since users of text translation software usually use text translation software directly to obtain translation results, it cannot pre-guide the expected correct translation. Therefore, in daily use, users cannot immediately check the reliability of the translation results of the text translation software by comparing the correct results.

[0004] In view of the above situation, a feasible solution is to use the metamorphic testing technology in the field of software engineering to conduct a preliminary check on the correctness of the translation output of the text translation software in the absence of or unknown correct translation results. Metamorphic testing technology determines whether the software output is likely to be wrong by checking the performance of the software on multiple interrelated inputs. For example, when checking whether the output of the program for calculating the specific value of the sine function sin is correct when the input is 5.67°, the metamorphic test does not directly check whether the program output itself is correct, but compares the program output with the output when the input is 5.67° and the output under inputs such as (180°-5.67°) and -5.67° according to the designed metamorphic relationship. Whether it meets the expected relationship, thereby preliminarily judging the reliability of the program output. Therefore, metamorphic testing can conduct a preliminary reliability check on the output translation of the text translation software when the correct translation result is unknown.

[0005] There are the following specific technical problems in applying metamorphosis testing to the real-time detection of the reliability of translation results of text translation software:

[0006] There is currently no fine-grained metamorphic relationship for text translation software. When identifying whether there are errors in the translation text of the translation software, there is currently no metamorphic relationship that can perform fine-grained comparisons on the translation text to accurately identify errors. Therefore, it is necessary to design a fine-grained metamorphic relationship suitable for text translation software based on the characteristics of the input and output of the text translation software.

[0007] Currently, there is no method that can adapt multiple input transformation methods to generate a variety of texts to be translated. Constructing a rich and diverse text to be translated helps improve test coverage and achieve more adequate test results. However, adapting a specific input transformation method requires designing and implementing a specific output comparison strategy, which will require a lot of complex natural language processing work. Therefore, it is necessary to design a flexible output comparison strategy based on the common characteristics of the input transformation method to achieve simultaneous adaptation of multiple input transformation methods.

[0008] Currently, there is no method that can accurately locate incorrectly translated text. Given a translation result of a text translation software, the incorrect translations usually only involve a few words. Locating these incorrectly translated words can help users use other correct translation results more efficiently. Currently, no method has been found to achieve accurate incorrect translation location, so it is necessary to design an error location method suitable for text translation software based on the error characteristics of text translation software. Summary of the invention

[0009] In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a method for providing instant reliability checking for the translation results of text translation software, designs fine-grained transformation relationships based on the innovative concept of word closure, adapts to diverse input change methods, and based on the relationship specifically implements the error location function that the existing methods cannot accomplish, thereby solving the problems existing in the methods in the prior art.

[0010] According to one aspect of the present invention, there is provided a method for checking the reliability of text translation software based on word closure, comprising:

[0011] Collecting the currently input text to be translated, performing a text transformation operation of replacing, deleting or adding text on the currently input text to be translated to obtain a transformed text to be translated, and constructing a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation;

[0012] Collect translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result;

[0013] Constructing a word closure unit between the text to be translated before and after the transformation and the translation result of the text by the text translation software based on the constructed word alignment relationship;

[0014] Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit to locate the word closure where the incorrect translation is located;

[0015] Summarize and present the inspection results and report on the reliability measurement status.

[0016] As a further technical solution, a text transformation operation of replacing, deleting or adding text to the currently input text to be translated is performed, including:

[0017] Perform word segmentation and word part-of-speech tagging on the currently input text to be translated, extract target words and construct a set of replaceable words; for each replaceable word in the set of replaceable words, query in turn whether there is a target word for replacement with similar contextual semantics; if there is, replace the word in the currently input text to be translated with the target word to obtain the transformed text to be translated;

[0018] Parsing the currently input text to be translated to obtain a phrase structure tree, performing depth-first traversal on the parsed phrase structure tree, and when a clause or phrase introduced by a preposition or conjunction is identified, deleting the text segment involved in the clause or phrase from the currently input text to be translated to obtain a transformed text to be translated;

[0019] Alternatively, the currently input text to be translated is decomposed into independent sentences to construct a sentence set; for each sentence in the sentence set, it is continued in turn to obtain a continued text, and it is identified whether the continued text is a complete text content. If so, the continued text is added to the end of the sentence of the currently input text to be translated to obtain the transformed text to be translated.

[0020] As a further technical solution, a word alignment relationship between the text to be translated before and after the transformation is constructed based on the applied transformation operation, including:

[0021] Perform word segmentation on the currently input text to be translated and the transformed text to be translated respectively, and construct respective word sets;

[0022] The words in the currently input text to be translated are judged in sequence, and if the word in the currently input text to be translated is not modified during the transformation operation and the word in the currently input text to be translated corresponds to the word in the transformed text to be translated, then a word alignment relationship before and after the transformation of the word is established;

[0023] A first word alignment relationship set is formed based on all word alignment relationships between the currently input text to be translated and the transformed text to be translated.

[0024] As a further technical solution, constructing a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result includes:

[0025] The translation result returned by the currently input text to be translated is segmented into words to construct a word set; for each word in the word set, whether there is a translation correspondence between the word in the translation result and the word in the currently input text to be translated, and if so, a word alignment relationship of the corresponding words is constructed; based on all the word alignment relationships, a second word alignment relationship set between the currently input text to be translated and its corresponding translation result is formed;

[0026] The translation result returned by the transformed text to be translated is segmented into words to construct a word set; for each word in the word set, it is identified in turn whether there is a translation correspondence between the word in the translation result and the word in the currently input text to be translated, and if so, a word alignment relationship of the corresponding words is constructed; based on all the word alignment relationships, a third word alignment relationship set between the transformed text to be translated and its corresponding translation result is formed.

[0027] As a further technical solution, a word closure unit between the text to be translated before and after the transformation and the translation result thereof by the text translation software is constructed based on the constructed word alignment relationship, including:

[0028] definition The text to be translated for the current input is the transformed text to be translated, , The translation result returned for the transformed text to be translated. is the first word alignment relation set, is the second word alignment relation set, is the third word alignment relationship set, for The words in for The words in To constitute The number of all words in To constitute The number of all words in ;

[0029] for , in turn Words in Do the following:

[0030] Word-based Initializing a Collection , , , , loop to perform the operation:

[0031] Sequentially Words in :

[0032] like There is a word alignment relationship in , then Add to collection ;

[0033] like There is a word alignment relationship in , then Add to collection ;

[0034] like Not empty, in turn Words in ;

[0035] like There is a word alignment relationship in , then Add to collection ;

[0036] like There is a word alignment relationship in , then Add to collection ;

[0037] like Not empty, in turn Words in ;

[0038] like There is a word alignment relationship in , then Add to collection ;

[0039] like Not empty, in turn Words in ;

[0040] like There is a word alignment relationship in , then Add to collection ;

[0041] like , , and If it is the same as the beginning of this loop operation, the closure is constructed and the loop operation ends;

[0042] Construct word closure: , close the word Recorded in word closure collection Among them for The number of word closures contained in ;

[0043] for , in turn Words in ;

[0044] Word-based Initializing a Collection , , , , loop to perform the operation:

[0045] like Not empty, in turn Words in :

[0046] like There is a word alignment relationship in , then Add to collection ;

[0047] like There is a word alignment relationship in , then Add to collection ;

[0048] Sequentially Words in ;

[0049] like There is a word alignment relationship in , then Add to collection ;

[0050] like There is a word alignment relationship in , then Add to collection ;

[0051] like Not empty, in turn Words in ;

[0052] like There is a word alignment relationship in , then Add to collection ;

[0053] like Not empty, in turn Words in ;

[0054] like There is a word alignment relationship in , then Add to collection ;

[0055] like , , and If it is the same as the beginning of this loop operation, the closure is constructed and the loop operation ends;

[0056] Construct word closure: , close the word Recorded in word closure collection middle.

[0057] As a further technical solution, based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit, including:

[0058] Sequentially Word closure in , Do the following:

[0059] If the word closure middle or If it is an empty set, it does not participate in the semantic consistency comparison;

[0060] If the word closure middle and are not empty, then remove the pause words respectively to get and The set of non-stop words;

[0061] Extract separately and The word vector of and The mean of all non-pause word vectors in ;

[0062] calculate The mean of all non-pause word vectors and Cosine similarity of the mean of all non-pause word vectors;

[0063] Semantic metric check is performed based on the calculated cosine similarity.

[0064] According to one aspect of the present invention, there is provided a text translation software reliability instant check system based on word closure, comprising:

[0065] The first main module is used to collect the currently input text to be translated, perform text transformation operations such as text replacement, text deletion or text addition on the currently input text to be translated to obtain the transformed text to be translated, and construct a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation;

[0066] The second main module is used to collect the translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and to construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result;

[0067] The third main module is used to construct a word closure unit between the text to be translated before and after the transformation and the translation result of the text translation software based on the constructed word alignment relationship;

[0068] The fourth main module is used to perform semantic metric check on the translation text matched inside each word closure unit based on the semantic word vector, and locate the word closure where the wrong translation is located;

[0069] The fifth main module is used to summarize and present the inspection results and report the reliability measurement status.

[0070] According to one aspect of the present invention, a computer device is provided, comprising a processor and a memory, wherein the memory stores program instructions executed by the processor, and the processor calls the program instructions to execute steps of the method.

[0071] According to one aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to execute the steps of the method.

[0072] According to one aspect of the present invention, there is provided a computer program product, comprising a computer program / instruction, wherein the computer program / instruction implements the steps of the method when executed by a processor.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] (1) The present invention aims to check the reliability of the translation software returned by the software without obtaining the reference translation result of the text translation software in advance. First, the text to be translated input by the user is collected, and the transformed text to be translated is obtained by performing a text transformation operation on the text to be translated currently input by the user, and a word alignment relationship between the text to be translated before and after the transformation is constructed based on the applied transformation operation; secondly, the translation results returned by the text translation software for the text to be translated currently input by the user and the transformed text to be translated are obtained, and a word alignment tool is used to construct a word alignment relationship between the text to be translated and its corresponding translation result; then a word closure set is constructed based on all word alignment relationships, and the translation text matched inside each word closure is checked based on the semantic word vector whether the semantic consistency is maintained; finally, the inspection results are summarized and displayed, and the reliability measurement is reported to the user. The idea of ​​the method is: if the translation results returned by the text translation software for the original text to be translated and the transformed text to be translated are correct, then the translation results corresponding to the same text in the text to be translated before and after the transformation should maintain semantic consistency, that is, the translation text matched inside the word closure should have consistent semantics. If the translation text matched inside the word closure has different semantics, it means that there is an error in the translation result of the text translation software.

[0075] (2) The method provided by the present invention is based on a fine-grained metamorphic relationship for text translation software, that is, a text transformation operation is performed based on the text to be translated currently input by the user to obtain the transformed text to be translated, a word alignment relationship is established between the text to be translated before and after the transformation and the translation result returned by the text translation software, and a word closure is constructed. The reliability of the translation result of the text translation software is checked by checking the semantic consistency of the fine-grained translation text matched inside the word closure one by one. The method can achieve accurate error detection through fine-grained semantic consistency measurement, thereby solving the problem that there is no fine-grained metamorphic relationship for text translation software; a word closure construction method that is adapted to various text transformation operations including text replacement, text deletion, and text addition is proposed, thereby solving the problem that there is no method that can adapt to various input transformation methods to generate various texts to be translated; a method for locating erroneous translation texts based on fine-grained word closure is proposed, thereby solving the problem that there is no method that can accurately locate erroneous translation texts.

[0076] (3) The method formed by the present invention can ultimately be used to preliminarily check the reliability of the translation results obtained by the user from the text translation software in a scenario where the user does not know the reference translation result of the input text to be translated during the use of the text translation software, thereby achieving the purpose of detecting the reliability of the translation results returned by the software without having to obtain the reference translation result of the text translation software in advance, and realizing the instant preliminarily checking the reliability of the translation results of the text translation software when the correct translation result is unknown, and feeding back the location information of the erroneous translation to the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction is given below to the drawings used 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 any creative work.

[0078] Figure 1 A flowchart of the method steps provided by an embodiment of the present invention.

[0079] Figure 2 An example diagram showing a transformed text with translation generated by a text replacement operation provided in an embodiment of the present invention;

[0080] Figure 3 An example diagram showing a transformed text with translation generated by a text deletion operation provided in an embodiment of the present invention;

[0081] Figure 4 An example diagram showing a transformed text with translation generated by a text adding operation provided in an embodiment of the present invention;

[0082] Figure 5 An example diagram showing the word alignment relationship between texts to be translated before and after the transformation provided by an embodiment of the present invention;

[0083] Figure 6 An example diagram showing the word alignment relationship between the text to be translated and its corresponding translation result before and after the transformation provided by the embodiment of the present invention;

[0084] Figure 7 An example diagram showing a word closure construction method provided by an embodiment of the present invention;

[0085] Figure 8 An example display diagram of a word closure set provided by an embodiment of the present invention;

[0086] Fig. 9 An example diagram showing the translation result correctness measurement provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0087] The purpose of the present invention is to detect the reliability of the translation results returned by the software without obtaining the reference translation results of the text translation software in advance, so as to alleviate the situation that the reliability of the translation results returned by the text translation software cannot be checked due to the lack of the reference translation results obtained in advance, resulting in the user directly accepting the wrong translation results and causing adverse effects. The present invention designs a fine-grained metamorphic relationship based on word closure for text translation software based on metamorphic testing technology, and designs a specific text transformation method to be translated, a word closure construction strategy and an error translation location method to perform error detection and error location on the results returned by the text translation software, so that the user can instantly and preliminarily check the reliability of the translation results of the text translation software without knowing the correct translation results.

[0088] Combine the following Figures 1 to 9 The specific implementation of the present invention is as follows: The present invention provides a method for checking the reliability of translation results of text translation software based on word closure, see Figure 1 ,include:

[0089] Step 1: Collect the text to be translated currently input by the user, perform text transformation operations such as text replacement, text deletion, or text addition on the text to be translated currently input by the user to obtain the transformed text to be translated, and construct a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation.

[0090] Preferably, in step 1, the text to be translated currently input by the user is collected:

[0091] The text to be translated currently input by the user is: ;

[0092] The language of the text to be translated currently input by the user is: ;

[0093] The text translation software is: .

[0094] In step 1, the text to be translated currently input by the user is subjected to a text transformation operation of replacing, deleting or adding text to obtain the transformed text to be translated:

[0095] The text to be translated obtained by performing a text replacement operation on the text to be translated currently input by the user is:

[0096] By using The universal text grammar relationship tool uses the user's current text to be translated Perform word segmentation and word part-of-speech tagging, extract noun words and adjective words as target words that can be replaced, and construct a set of replaceable words as follows:

[0097] ,

[0098] in, , It is Alternative words, is the number of all replaceable words;

[0099] for , for the replaceable words ;

[0100] Based on the deep learning word embedding model, it is necessary to query whether words with similar contextual semantics can be used for replacement. middle Target word;

[0101] If you find that it can be used to replace Target word ,Will In Replace with Get the transformed text to be translated .

[0102] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0103] By using the spaCy universal text grammar relation tool to translate the user's current text Perform word segmentation and word part-of-speech tagging, and extract words whose word part-of-speech tagging results are "NN", "NNS", "NNP", "JJ" and "JJS" as target words that can be replaced;

[0104] Use the deep learning word embedding model Bert-base-cased to query whether the target word that can be replaced has similar contextual semantics and can be used for replacement middle Target word;

[0105] If a query with similar context semantics is found, it can be used to replace middle The new word of the target word, then In Replace with Get the transformed text to be translated ;

[0106] Attached Figure 2 This shows the effect of implementing the above steps, using spaCy to Perform word segmentation and word part-of-speech tagging to obtain the target word "pandemic" with the word part-of-speech tagging result of "NN" that can be used for replacement operation; use the Bert-base-cased model to query "pandemic" with similar contextual semantics that can be used to replace the target word "holiday"; Replace "pandemic" with "holiday" to get the transformed text to be translated .

[0107] The text to be translated obtained by performing a text deletion operation on the text to be translated currently input by the user is:

[0108] By using the spaCy universal text grammar relation tool to translate the user's current text Analyze and get The phrase structure tree of Perform a depth-first traversal of the phrase structure tree;

[0109] If identified Contains clauses or phrases of time, cause, place, condition, purpose, result, concession, comparison, and manner introduced by prepositions or conjunctions ,from Delete a clause or phrase from The text segment involved gets the transformed text to be translated .

[0110] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0111] By using the spaCy universal text grammar relation tool to translate the user's current text Analyze and get The phrase structure tree of Perform a depth-first traversal of the phrase structure tree;

[0112] If identified Contains a phrase preceded by a preposition tagged with "IN" or a conjunction tagged with "WRB" or "CC" and a structural tag "PP" or a clause tagged with "SBAR" ,from Delete a clause or phrase from The text segment involved gets the transformed text to be translated ;

[0113] Attached Figure 3 This shows the effect of implementing the above steps, parsed using spaCy Obtain the phrase structure tree and traverse it; identify the prepositional phrase with the preposition with the part-of-speech tag result of "IN" as the root node and the structure tag result of "PP"; Delete the text segment involved in the prepositional phrase to obtain the transformed text to be translated .

[0114] The text to be translated obtained by performing a text adding operation on the text to be translated currently input by the user is:

[0115] By using the spaCy universal text grammar relation tool to translate the user's current text Disassemble to get independent sentences and construct the sentence set as follows:

[0116] ,

[0117] in, yes No. Sentences, for The number of all sentences included;

[0118] for , and the sentences , based on the deep learning text generation model, it is continued to obtain the continued text , by identifying the continued text Whether it ends with a period Whether it is complete text content;

[0119] If you continue writing the text For complete text content, Add to Sentences in The tail of the transformed text to be translated .

[0120] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0121] Get the user's current text to be translated by using the spaCy universal text grammar relationship tool The grammatical structure tree is identified and extracted from it, and the sentence components with the structural annotation result of "S" are identified;

[0122] For each sentence, we continue to write it based on the deep learning text generation model GPT-2 to get the continued text. If the continued text ends with a period ".", we add the continued text to The tail of the sentence in the text to be translated is obtained ;

[0123] Attached Figure 4 This shows the effect of implementing the above steps, parsed using spaCy The sentence set contains: For the second sentence "This is what we train for", the text generation model GPT-2 is used to continue it and get the continuation text "during the Paris Games."; because the continuation text is structured as a period, it means that the continuation text is complete, so the continuation text is added to The tail of the second sentence in the text to be translated is obtained .

[0124] The word alignment relationship between the text to be translated before and after the transformation is constructed based on the applied transformation operation in step 1 is:

[0125] By using the spaCy universal text grammar relation tool to translate the text currently entered by the user and the transformed text to be translated Perform word segmentation and construct and The word set is:

[0126]

[0127]

[0128] in, yes No. words, To constitute The number of all words in ;

[0129] yes No. words, To constitute The number of all words in ;

[0130] for , in turn Words in Make judgments;

[0131] If through the transformation generate In the process of Words in Make changes and Words in Corresponds to Words in , then construct the word alignment relationship:

[0132] ,

[0133] All and All word alignment relationships between Constructing a word alignment relationship set .

[0134] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0135] According to the attached Figure 5 As shown, based on The word "pandemic" in the text is replaced with the word "holiday" to get Then, use spaCy to and Perform word segmentation;

[0136] for The remaining words in the text except "pandemic" because they were not modified and are in To maintain consistency in the The remaining words except "pandemic" are The word alignment relationship between the corresponding words in , the constructed word alignment relationship is shown by the dotted arrow in the figure.

[0137] Preferably, the text translation software in step 2 collects the translation results of the text to be translated currently input by the user and the transformed text to be translated as follows:

[0138] The language of the translation text expected by the user is: ;

[0139] The text translation software returns the translation result for the text to be translated currently input by the user: ;

[0140] The translation result returned by the text translation software for the transformed text to be translated is: ;

[0141] In step 2, the word alignment relationship between the text to be translated currently input by the user and its corresponding translation result and the word alignment relationship between the transformed text to be translated and its corresponding translation result are constructed as follows:

[0142] The word alignment relationship between the text to be translated currently input by the user and its corresponding translation result is constructed as follows:

[0143] By using the spaCy universal text grammar relationship tool to translate the text currently entered by the user, the text translation software The translation results returned Perform word segmentation and construct The word set is:

[0144] ,

[0145] in, yes No. words, To constitute The number of all words in ;

[0146] for , in turn Words in ;

[0147] By using the text word alignment tool, identify Words in and Words in If there is a pair alignment relationship, then a word alignment relationship is constructed:

[0148] ,

[0149] All and All word alignment relationships between Constructing a word alignment relationship set .

[0150] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0151] By using the spaCy universal text grammar relationship tool to translate the text currently entered by the user, the text translation software The translation results returned Perform word segmentation;

[0152] Use the word alignment tool Awesome-align and Build word alignment relationship between the word segmentation results;

[0153] Attached Figure 6 The diagram on the left shows the effect of implementing the above steps, using spaCy to obtain and The word segmentation results of and A word alignment relationship is constructed between the word segmentation results, and the constructed word alignment relationship is shown by the dotted arrow in the figure.

[0154] The word alignment relationship between the transformed text to be translated and its corresponding translation result is constructed as follows:

[0155] By using the spaCy universal text grammar relationship tool to translate the text currently entered by the user, the text translation software The translation results returned Perform word segmentation and construct The word set is:

[0156] ,

[0157] in, yes No. words, To constitute The number of all words in ;

[0158] for , in turn Words in ;

[0159] By using the text word alignment tool, identify Words in and Words in If there is a pair alignment relationship, then a word alignment relationship is constructed:

[0160] ,

[0161] All and All word alignment relationships between Constructing a word alignment relationship set .

[0162] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0163] By using the spaCy universal text grammar relationship tool to translate the text currently entered by the user, the text translation software The translation results returned Perform word segmentation;

[0164] Use the word alignment tool Awesome-align and Build word alignment relationship between the word segmentation results;

[0165] Attached Figure 6 The diagram on the right shows the effect of implementing the above steps, using spaCy to obtain and The word segmentation results of and A word alignment relationship is constructed between the word segmentation results, and the constructed word alignment relationship is shown by the dotted arrow in the figure.

[0166] Preferably, in step 3, the word closure unit between the text to be translated and the translation result thereof by the text translation software before and after the transformation based on the word alignment relationship constructed in step 1 and step 2 is:

[0167] for , in turn Words in Do the following:

[0168] Word-based Initializing a Collection , , , , loop to perform the operation:

[0169] Sequentially Words in :

[0170] like There is a word alignment relationship in , then Add to collection ;

[0171] like There is a word alignment relationship in , then Add to collection ;

[0172] like Not empty, in turn Words in ;

[0173] like There is a word alignment relationship in , then Add to collection ;

[0174] like There is a word alignment relationship in , then Add to collection ;

[0175] like Not empty, in turn Words in ;

[0176] like There is a word alignment relationship in , then Add to collection ;

[0177] like Not empty, in turn Words in ;

[0178] like There is a word alignment relationship in , then Add to collection ;

[0179] like , , and If it is the same as the beginning of this loop operation, the closure is constructed and the loop operation ends;

[0180] Construct word closure: , close the word Recorded in word closure collection Among them for The number of word closures contained in ;

[0181] for , in turn Words in ;

[0182] Word-based Initializing a Collection , , , , loop to perform the operation:

[0183] like Not empty, in turn Words in :

[0184] like There is a word alignment relationship in , then Add to collection ;

[0185] like There is a word alignment relationship in , then Add to collection ;

[0186] Sequentially Words in ;

[0187] like There is a word alignment relationship in , then Add to collection ;

[0188] like There is a word alignment relationship in , then Add to collection ;

[0189] like Not empty, in turn Words in ;

[0190] like There is a word alignment relationship in , then Add to collection ;

[0191] like Not empty, in turn Words in ;

[0192] like There is a word alignment relationship in , then Add to collection ;

[0193] like , , and If it is the same as the beginning of this loop operation, it means that the closure is constructed and the loop operation ends; otherwise, the loop executes the above operations;

[0194] Construct word closure: , close the word Recorded in word closure collection middle.

[0195] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0196] Attached Figure 7 The above steps are shown in the following figure. The word "maintenance" in the , , , , based on the attached Figure 5 and attached Figure 6 The constructed word alignment , , Loop through operations;

[0197] Sequentially Words in, for example, the word ,because There is a word alignment relationship in , then Add to collection ;

[0198] Sequentially Words in ,because There is a word alignment relationship in , then Add to collection ;

[0199] Sequentially Words in, for example, the word ,because There is a word alignment relationship in , then Add to collection ;

[0200] Sequentially Words in ,because There is a word alignment relationship in , then Add to collection ;

[0201] Sequentially Words in ,because There is a word alignment relationship in , then Add to collection ;

[0202] Sequentially Words in ,because There is a word alignment relationship in , then Add to collection ;

[0203] Repeat the above steps until , , and If it remains unchanged, the loop ends;

[0204] Finally get , , , , construct the word closure: , close the word Recorded in word closure collection In, attached Figure 8 Shows the set of all word closures constructed .

[0205] Preferably, in step 4, based on the semantic word vector, a semantic measurement check is performed on the translation text matched inside each word closure unit to see whether it meets expectations:

[0206] Based on the word closure set obtained in step 3 , in turn Word closure in , :

[0207] If the word closure middle or It is an empty set and does not participate in the semantic consistency comparison. Word Closure Test results ;

[0208] Otherwise, the word closure middle and Are not empty, and remove the pause words to get and The set of non-stop words:

[0209]

[0210] ,

[0211] in, for The number of non-stop words in for The number of non-stop words in for The non-stop words, for The non-stop words;

[0212] By extracting the semantic word vector of a word from the pre-trained semantic word vector library, Calculate in sequence The non-stop words Get semantic word vectors, remember The semantic word vector of ;

[0213] By extracting the semantic word vector of a word from the pre-trained semantic word vector library, Calculate in sequence The non-stop words Get semantic word vectors, remember The semantic word vector of ;

[0214] calculate The mean of all non-pause word vectors in is:

[0215]

[0216] calculate The mean of all non-pause word vectors in is:

[0217]

[0218] calculate and The cosine similarity is ;

[0219] Set the target language The text cosine similarity measurement threshold is ;

[0220] like , then the word is considered closed middle The translation results included are semantically equivalent and meet expectations. Word Closure Test results ;

[0221] Otherwise, the word is considered closed. middle The semantics of the included translation results are not equivalent, which is not in line with expectations. Word Closure Test results ;

[0222] for , The results of semantic consistency check of all words in Construct a word closure semantic consistency check result set:

[0223] ,

[0224] in for Middle Word Closure The semantic consistency check results of .

[0225] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0226] Attached Fig. 9 This shows the effect of implementing the above steps, word closure middle and Are not empty sets, use spaCy tool to remove the stop words, get and The set of non-stop words:

[0227]

[0228] ,

[0229] Extract semantic word vectors of the words "lens", "landscape", and "scenery" from the deep learning pre-training model Bert-base-cased;

[0230] calculate The mean of all non-stop words "lens" and "scenery" vectors in is:

[0231] ,

[0232] calculate The mean of all non-pause word vectors in is:

[0233] ,

[0234] calculate and The cosine similarity is ;

[0235] because The cosine similarity measurement threshold for texts greater than the translation target language "Chinese" is , so the word closure is considered middle The included translation results are semantically equivalent, as expected, and word closure is set Test results .

[0236] The closure of the word where the incorrect translation is located in step 4 is:

[0237] Check word closure semantic consistency for word closures in the result set The semantic consistency check results of The value is Word closure The set of word closures that constitute the localized incorrect translation:

[0238] ,

[0239] in, for The number of word closures with localized mistranslations in , for Middle A closure to locate mistranslated words.

[0240] In the specific implementation process, taking the English-Chinese translation service for text translation software as an example, one method to achieve the above process is:

[0241] Attached Fig. 9 This shows the effect of implementing the above steps, where the highlighted word closure is the result of the semantic consistency check. The value is The word closure of , so the word closure set of the localized mistranslation in this case is .

[0242] Preferably, the summary and display of the inspection results in step 5, and the reporting of the reliability measurement to the user are as follows:

[0243] Display the generated transformed text to be translated to the user through an interactive interface , and the text translation software translates the text currently entered by the user and the transformed text to be translated Translation results of and ;

[0244] Through the interactive interface, users can , , and The constructed word closure set A collection of semantic consistency checks with each word closure ;

[0245] Count word closures in the word closure semantic consistency check result set The semantic consistency check results of The value is The number of ;

[0246] like , then the user is presented with a word closure set of incorrectly translated locations through an interactive interface , and prompt the user to verify The closure of each mistranslated word in Internal Collection , The translation results included;

[0247] Otherwise, the translation results returned by the reporting translation software have passed the inspection and should be basically reliable.

[0248] Once the basic creative concept is known to those skilled in the art, additional changes and modifications may be made to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the invention.

[0249] The realization basis of each embodiment of the present invention is to carry out programmed processing realization by the equipment with processor function.Therefore in engineering practice, the technical scheme and function thereof of each embodiment of the present invention are encapsulated into various modules.Based on this reality, on the basis of each embodiment mentioned above, the embodiment of the present invention provides a kind of text translation software reliability instant checking system based on word closure, and this system is used for executing the text translation software reliability instant checking method based on word closure in the above-mentioned method embodiment.

[0250] The system comprises: a first main module, which is used to collect currently input text to be translated, perform text transformation operations such as text replacement, text deletion or text addition on the currently input text to be translated to obtain transformed text to be translated, and construct a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation; a second main module, which is used to collect translation results of the currently input text to be translated and the transformed text to be translated by text translation software, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result; a third main module, which is used to construct a word closure unit between the text to be translated before and after the transformation and the translation result of the text translation software based on the constructed word alignment relationship; a fourth main module, which is used to perform semantic measurement inspection on the translation text matched inside each word closure unit based on semantic word vectors, and locate the word closure where the wrong translation is located; and a fifth main module, which is used to summarize and display the inspection results, and report the reliability measurement situation.

[0251] The word closure-based real-time text translation software reliability check system provided in the embodiment of the present invention utilizes the above-mentioned modules to instantly check the reliability of the translation results returned by the text translation software when the correct translation results are unknown. At the same time, it can adapt to a variety of input transformation methods to generate a variety of texts to be translated, and accurately locate erroneous translations.

[0252] It should be noted that the system embodiments provided by the present invention are not only used to implement the methods in the above-mentioned method embodiments, but also used to implement the methods in other method embodiments provided by the present invention. The only difference lies in the setting of corresponding functional modules, and the principles thereof are basically the same as the principles of the above-mentioned system embodiments provided by the present invention. As long as technical personnel in this field refer to the specific technical solutions in other method embodiments on the basis of the above-mentioned system embodiments, obtain corresponding technical means and technical solutions composed of these technical means by combining technical features, and on the premise of ensuring the practicality of the technical solutions, they will improve the equipment in the above-mentioned system embodiments to obtain corresponding system embodiments for implementing the methods in other method embodiments.

[0253] Based on the same inventive concept as the above embodiment, an embodiment of the present invention further provides a computer device, including a processor and a memory, wherein the memory stores program instructions executed by the processor, and the processor calls the program instructions to execute the steps of the method, including:

[0254] Collecting the currently input text to be translated, performing a text transformation operation of replacing, deleting or adding text on the currently input text to be translated to obtain a transformed text to be translated, and constructing a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation;

[0255] Collect translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result;

[0256] Constructing a word closure unit between the text to be translated before and after the transformation and the translation result of the text by the text translation software based on the constructed word alignment relationship;

[0257] Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit to locate the word closure where the incorrect translation is located;

[0258] Summarize and present the inspection results and report on the reliability measurement status.

[0259] Based on the same inventive concept as the above embodiment, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to execute the steps of the method, including:

[0260] Collecting the currently input text to be translated, performing a text transformation operation of replacing, deleting or adding text on the currently input text to be translated to obtain a transformed text to be translated, and constructing a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation;

[0261] Collect translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result;

[0262] Constructing a word closure unit between the text to be translated before and after the transformation and the translation result of the text by the text translation software based on the constructed word alignment relationship;

[0263] Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit to locate the word closure where the incorrect translation is located;

[0264] Summarize and present the inspection results and report on the reliability measurement status.

[0265] Based on the same inventive concept as the above embodiment, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of implementing the method include:

[0266] Collecting the currently input text to be translated, performing a text transformation operation of replacing, deleting or adding text on the currently input text to be translated to obtain a transformed text to be translated, and constructing a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation;

[0267] Collect translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result;

[0268] Constructing a word closure unit between the text to be translated before and after the transformation and the translation result of the text by the text translation software based on the constructed word alignment relationship;

[0269] Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit to locate the word closure where the incorrect translation is located;

[0270] Summarize and present the inspection results and report on the reliability measurement status.

[0271] In summary, the present invention collects the text to be translated currently input by the user, obtains the transformed text to be translated by performing a text transformation operation on the text to be translated, and constructs the word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation; secondly, the translation result returned by the text translation software for the text to be translated currently input by the user and the transformed text to be translated is obtained, and a word alignment tool is used to construct the word alignment relationship between the text to be translated and its corresponding translation result; then a word closure set is constructed based on all word alignment relationships, and the translation text matched inside each word closure is checked based on the semantic word vector to see whether the semantic consistency is maintained; finally, the inspection results are summarized and displayed and the reliable measurement is reported to the user. If the translation text matched inside the word closure is detected to have different semantics, the translation text does not meet expectations, indicating that the translation result returned by the text translation software for the text to be translated currently input by the user may be wrong. The invention can instantly check the reliability of the translation result returned by the text translation software when the correct translation result is unknown, and can adapt to a variety of input transformation methods to generate a variety of texts to be translated, and can accurately locate the wrong translation.

[0272] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A method for checking the reliability of text translation software based on word closure, characterized in that: Based on the word closure concept, a fine-grained metamorphosis relationship is designed to adapt to a variety of input change methods, and an error location function is specifically implemented based on the relationship. The method includes: Collect the currently input text to be translated, perform a text transformation operation of replacing, deleting or adding text on the currently input text to be translated to obtain the transformed text to be translated, and construct a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation; wherein, performing a text transformation operation of adding text on the currently input text to be translated to obtain the transformed text to be translated includes: decomposing the currently input text to be translated to obtain independent sentences and constructing a sentence set; for each sentence in the sentence set, sequentially continuing to obtain a continued text, and identifying whether the continued text is a complete text content, and if so, adding the continued text to the end of the sentence of the currently input text to be translated to obtain the transformed text to be translated; Collect translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result; Constructing a word closure unit between the text to be translated before and after the transformation and the translation result of the text by the text translation software based on the constructed word alignment relationship; Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit to locate the word closure where the incorrect translation is located; Summarize and present the inspection results and report on the reliability measurement status.

2. The method for checking the reliability of text translation software based on word closure according to claim 1, characterized in that: Perform text transformation operations such as text replacement, text deletion, or text addition on the currently input text to be translated, including: Perform word segmentation and word part-of-speech tagging on the currently input text to be translated, extract target words and construct a set of replaceable words; for each replaceable word in the set of replaceable words, query in turn whether there is a target word for replacement with similar contextual semantics; if there is, replace the word in the currently input text to be translated with the target word to obtain the transformed text to be translated; The currently input text to be translated is parsed to obtain a phrase structure tree, and the parsed phrase structure tree is traversed in depth first. When a clause or phrase introduced by a preposition or conjunction is identified, the text segment involved in the clause or phrase is deleted from the currently input text to be translated to obtain a transformed text to be translated.

3. The method for checking the reliability of text translation software based on word closure according to claim 1, characterized in that: Constructing word alignments between the text to be translated before and after the transformation based on the applied transformation operations, including: Perform word segmentation on the currently input text to be translated and the transformed text to be translated respectively, and construct respective word sets; The words in the currently input text to be translated are judged in sequence, and if the word in the currently input text to be translated is not modified during the transformation operation and the word in the currently input text to be translated corresponds to the word in the transformed text to be translated, then a word alignment relationship before and after the transformation of the word is established; A first word alignment relationship set is formed based on all word alignment relationships between the currently input text to be translated and the transformed text to be translated.

4. The method for checking the reliability of text translation software based on word closure according to claim 1, characterized in that: Constructing a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result, including: The translation result returned by the currently input text to be translated is segmented into words to construct a word set; for each word in the word set, whether there is a translation correspondence between the word in the translation result and the word in the currently input text to be translated, and if so, a word alignment relationship of the corresponding words is constructed; based on all the word alignment relationships, a second word alignment relationship set between the currently input text to be translated and its corresponding translation result is formed; The translation result returned by the transformed text to be translated is segmented into words to construct a word set; for each word in the word set, it is identified in turn whether there is a translation correspondence between the word in the translation result and the word in the currently input text to be translated, and if so, a word alignment relationship of the corresponding words is constructed; based on all the word alignment relationships, a third word alignment relationship set between the transformed text to be translated and its corresponding translation result is formed.

5. The method for checking the reliability of text translation software based on word closure according to claim 1, characterized in that: A word closure unit between the text to be translated before and after the transformation and the translation result thereof by the text translation software is constructed based on the constructed word alignment relationship, including: Definition S s is the text to be translated currently input, S f is the transformed text to be translated, T s The translation result returned for the currently input text to be translated, T f The translation result returned for the transformed text to be translated. is the first word alignment relation set, is the second word alignment relation set, is the third word alignment relationship set, For S s The words in For S f The words in To constitute S s The number of all words in To constitute S f The number of all words in ; for S s Words in Do the following: Word-based Initializing a Collection Loop execution: Sequentially Words in like There is a word alignment relationship in Then Add to collection like There is a word alignment relationship in Then Add to collection like Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like There is a word alignment relationship in Then Add to collection like Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like and If it is consistent with the beginning of this loop operation, the closure is constructed and the loop operation ends; construct the word closure: Closing the word Recorded in word closure collection Among them for The number of word closures contained in ; for S f Words in Word-based Initializing a Collection Loop execution operation: If Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like There is a word alignment relationship in Then Add to collection Sequentially Words in like There is a word alignment relationship in Then Add to collection like There is a word alignment relationship in Then Add to collection like Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like Not empty, in turn Words in like There is a word alignment relationship in Then Add to collection like and If it is the same as the beginning of this loop operation, the closure is constructed and the loop operation ends; Construct word closure: Closing the word Recorded in word closure collection middle.

6. The method for checking the reliability of text translation software based on word closure according to claim 5, characterized in that: Based on the semantic word vector, a semantic metric check is performed on the translation text matched inside each word closure unit, including: Sequentially Word closure in Do the following: If the word closure middle or If it is an empty set, it does not participate in the semantic consistency comparison; If the word closure middle and are not empty, then remove the pause words respectively to get and The set of non-stop words; Extract separately and The word vector of and The mean of all non-pause word vectors in ; calculate The mean of all non-pause word vectors and Cosine similarity of the mean of all non-pause word vectors; Semantic metric check is performed based on the calculated cosine similarity.

7. A text translation software reliability instant check system based on word closure, used to implement the method described in any one of claims 1 to 6, characterized in that: include: The first main module is used to collect the currently input text to be translated, perform text transformation operations such as text replacement, text deletion or text addition on the currently input text to be translated to obtain the transformed text to be translated, and construct a word alignment relationship between the text to be translated before and after the transformation based on the applied transformation operation; The second main module is used to collect the translation results of the text translation software for the currently input text to be translated and the transformed text to be translated, and to construct a word alignment relationship between the currently input text to be translated and its corresponding translation result and a word alignment relationship between the transformed text to be translated and its corresponding translation result; The third main module is used to construct a word closure unit between the text to be translated before and after the transformation and the translation result of the text translation software based on the constructed word alignment relationship; The fourth main module is used to perform semantic metric check on the translation text matched inside each word closure unit based on the semantic word vector, and locate the word closure where the wrong translation is located; The fifth main module is used to summarize and present the inspection results and report the reliability measurement status.

8. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program instructions executed by the processor, and the processor calls the program instructions to execute the steps of the method according to any one of claims 1 to 6.

9. A non-transitory computer readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the steps of the method of any one of claims 1 to 6.

10. A computer program product, comprising a computer program / instructions, which implement the steps of the method according to any one of claims 1 to 6 when executed by a processor.