Text translation method and system based on multi-language entries

By extracting and segmenting entries in multilingual documents, key-value pair matching and correction processing, and combining the language translation model to realize automatic document translation, it solves the problem of low efficiency and accuracy of multilingual text translation in App internationalization, and improves the Translation efficiency and accuracy.

WO2025000847A1PCT designated stage expired Publication Date: 2025-01-02TIANJIN HUALAI TECH CO LTD

Patent Information

Application Number
PCT/CN2023/133728
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-30
Filing Date
2023-11-23
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

In the internationalization process of Apps, when adding multilingual documents on a single language basis, you need to manually query, copy and paste entries, resulting in low efficiency and accuracy of multilingual entries text translation.

Method used

By obtaining multilingual documents, extracting target strings, segmenting them into entries, performing key-value pair matching and numerical matching analysis, modifying and generating documents to be translated, and using the language translation model for document translation, avoiding manual errors and inefficiency .

Benefits of technology

It improves the efficiency and accuracy of multilingual entries text translation, reduces manual processing errors, and simplifies the multilingual document translation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133728_02012025_PF_FP_ABST
    Figure CN2023133728_02012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a text translation method and system based on multi-language entries. The method comprises: acquiring a multi-language document, and performing character string extraction on the multi-language document to obtain a target character string; performing character string segmentation processing on the target character string to obtain a plurality of entries, performing data extraction to obtain key values of the entries and content values of the entries, and performing key-value pair matching to obtain a plurality of key-value pairs; performing numerical value matching analysis on each key-value pair to obtain a numerical value matching analysis result, and performing correction processing on the plurality of key-value pairs to obtain a plurality of target key-value pairs; performing character string generation on the plurality of target key-value pairs to obtain a plurality of target key-value character strings, and performing format conversion on the plurality of target key-value character strings to obtain a document to be translated; and by means of a language translation model, performing document translation on the document to be translated, to obtain a target document.
Need to check novelty before this filing date? Find Prior Art

Description

Text translation method and system based on multilingual terms

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 30, 2023, with application number: 202310790221.2, and invention name: "Text translation method and system based on multilingual terms", the entire content of which is incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of data processing technology, and in particular to a text translation method and system based on multilingual terms. Background Art

[0003] With the continuous development of Internet technology, the internationalization of App is becoming more and more popular, which requires App to support multiple languages. Ordinary iOS development uses the multi-language text provided by Apple for configuration. The general development process is to make a single-language version of the App first. After the single language version is launched, if there is a multi-language requirement, the developer needs to export the multi-language terms that need to be translated into Excel documents. After translation, the Excel document provided by the translator is used.

[0004] However, when adding other multilingual documents based on a single language, the process of adding other languages ​​requires querying, copying, and pasting, and requires operations on each entry one by one. This is time-consuming and the workflow is tedious, resulting in low efficiency and accuracy when translating text for multilingual entries.

[0005] Summary of the Invention

[0006] In view of this, the embodiments of the present application provide a text translation method and system based on multilingual terms, which solve the technical problems of low efficiency and accuracy when translating text of multilingual terms.

[0007] The present application provides a text translation method based on multilingual terms, comprising: obtaining a multilingual document, and simultaneously performing string extraction on the multilingual document to obtain a target string; performing string segmentation processing on the target string to obtain multiple terms, and simultaneously performing data extraction on the multiple terms to obtain a key value corresponding to each term and a content value corresponding to each term; performing key-value pair matching on the key value corresponding to each term and the content value corresponding to each term to obtain multiple groups of key-value pairs; performing numerical matching analysis on each group of key-value pairs to obtain a numerical matching analysis result, and performing correction processing on the multiple groups of key-value pairs based on the numerical matching analysis result to obtain multiple groups of target key-value pairs; performing string generation on the multiple groups of target key-value pairs to obtain multiple target key-value strings, and performing format conversion on the multiple target key-value strings to obtain a document to be translated; and performing document translation on the document to be translated using a language translation model to obtain a target document.

[0008] The present application also provides a text translation system based on multilingual terms, comprising: an acquisition module configured to acquire multilingual documents and, at the same time, perform string extraction on the multilingual documents to obtain a target string; a segmentation module configured to perform string segmentation processing on the target string to obtain multiple terms and, at the same time, perform data extraction on the multiple terms to obtain a key value corresponding to each term and a content value corresponding to each term; a matching module configured to perform key-value pair matching on the key value corresponding to each term and the content value corresponding to each term to obtain multiple groups of key-value pairs; an analysis module configured to perform numerical matching analysis on each group of key-value pairs to obtain a numerical matching analysis result, and to perform correction processing on the multiple groups of key-value pairs based on the numerical matching analysis result to obtain multiple groups of target key-value pairs; a generation module configured to perform string generation on the multiple groups of target key-value pairs to obtain multiple target key-value strings, and to perform format conversion on the multiple target key-value strings to obtain a document to be translated; and a translation module configured to perform document translation on the document to be translated using a language translation model to obtain a target document.

[0009] In the technical solution provided by the present application, a multilingual document is obtained, and at the same time, a string extraction is performed on the multilingual document to obtain a target string; a string segmentation process is performed on the target string to obtain multiple entries, and at the same time, data extraction is performed on the multiple entries to obtain a key value corresponding to each entry and a content value corresponding to each entry; a key-value pair matching process is performed on the key value corresponding to each entry and the content value corresponding to each entry to obtain multiple groups of key-value pairs; a numerical matching analysis is performed on each group of key-value pairs to obtain a numerical matching analysis result, and the multiple groups of key-value pairs are corrected based on the numerical matching analysis result to obtain multiple groups of target key-value pairs; a string generation process is performed on the multiple groups of target key-value pairs to obtain multiple target key-value strings, and the multiple target key-value strings are format-converted to obtain a document to be translated; and a document to be translated is translated by a language translation model to obtain a target document. By correcting multiple groups of key-value pairs based on the results of numerical matching analysis, multiple groups of target key-value pairs are obtained; character strings are generated for the multiple groups of target key-value pairs to obtain multiple target key-value strings, and the multiple target key-value strings are format-converted to obtain documents to be translated, which can avoid errors in manual processing, and by translating the documents to be translated through a language translation model to obtain target documents, which can effectively avoid the problem of low efficiency in manual translation. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0011] FIG1 is a flowchart of a text translation method based on multilingual terms in an embodiment of the present application;

[0012] FIG2 is a flow chart of generating character strings for multiple sets of target key-value pairs in an embodiment of the present application;

[0013] FIG3 is a schematic diagram of a text translation system based on multilingual terms in an embodiment of the present application.

[0014] Reference numerals: 301, acquisition module; 302, segmentation module; 303, matching module; 304, analysis module; 305, generation module; 306, translation module. DETAILED DESCRIPTION

[0015] The following will clearly and completely describe the technical solution of this application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0016] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," "outer," and the like, indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this application and simplify the description. They are not intended to indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are provided for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0017] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0018] For ease of understanding, the specific process of the embodiment of the present application is described below. Please refer to Figure 1, which is a flowchart of the text translation method based on multilingual terms in the embodiment of the present application. As shown in Figure 1, the method includes the following steps:

[0019] S101, obtaining a multilingual document, and performing character string extraction on the multilingual document to obtain a target character string;

[0020] Specifically, the multilingual document in string format in the program is copied to the address read by the tool, and all the strings in the string file are read. It should be noted that for string extraction, in the embodiment of the present application, regular expressions are used to extract the target string according to its characteristics. In addition, when extracting strings from multilingual documents, it is also necessary to consider the possible differences between different languages ​​to avoid translation errors or format inconsistencies.

[0021] S102: Segment the target character string to obtain multiple entries, and extract data from the multiple entries to obtain a key value corresponding to each entry and a content value corresponding to each entry;

[0022] Specifically, before performing string segmentation and parsing, first determine the delimiter used between each term, such as a comma, colon, tab, etc. Based on the selected delimiter, use the corresponding string operation function or regular expression to segment the target string to obtain multiple terms. When segmenting a string, it is important to note that if multiple delimiters appear consecutively, blank terms or abnormal situations may exist after segmentation, requiring special processing. It should be noted that for each term, there is usually a key-value corresponding structure, namely key and value. When extracting this data, it is necessary to use string operation functions or regular expressions again to extract the key and value from the term content.

[0023] S103, performing key-value pair matching on the key value corresponding to each entry and the content value corresponding to each entry to obtain multiple groups of key-value pairs;

[0024] Specifically, key-value pairs are matched for the key value corresponding to each entry and the content value corresponding to each entry. First, the keys and values ​​of all entries are traversed. For each set of keys and values, they are matched and combined to form a key-value pair. Each key-value pair is stored in a new array or hash table. When matching, the matching method needs to be determined according to the specific situation, such as full match, partial match, case-insensitive match, etc. When matching, special cases that may exist need to be considered, such as multiple entries with the same key value but different value values. Specifically, for each key value, all key arrays or hash tables are searched for the corresponding key. If the corresponding key is found, the corresponding value needs to be compared to determine whether the matching conditions are met. If the match is successful, it means that the key and value in the entry can be combined into a key-value pair.

[0025] S104, performing a numerical matching analysis on each key-value pair to obtain a numerical matching analysis result, and performing correction processing on multiple key-value pairs based on the numerical matching analysis result to obtain multiple target key-value pairs;

[0026] Specifically, the process of performing numerical matching analysis on each key-value pair typically requires first determining the value type to be matched and the matching rules. During numerical matching analysis, the following situations may occur: If the two values ​​match, the key-value pair is valid and can be used directly. If the two values ​​do not match, it is necessary to consider whether to correct or mark them as invalid. If there are multiple strings with the same key value but different values, they need to be deduplicated. Based on the above situation, key-value pairs that successfully match can be stored or used directly without further operation. Key-value pairs that fail to match require appropriate methods for correction or marking. If a key-value pair cannot be corrected or is invalid, it can be deleted from the dataset or marked as invalid. For entries with multiple matching key values ​​but different values, deduplication is required. A data structure such as a hash table can be used to store all entries with the same key value in the same bucket, and then the entry strings within each bucket are compared and corrected. When checking values, you can use a string similarity algorithm (such as Levenshtein distance). If two values ​​do not match, you can convert them to a standard format, add missing information, or mark them as invalid.

[0027] S105, generating character strings for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and converting the multiple target key-value character strings into different formats to obtain a document to be translated;

[0028] Specifically, you first need to traverse all key-value pairs, which can be achieved through loops and other methods. For each key-value pair, concatenate its key and value into a string, and arrange and concatenate them according to a specific format. For example, you can use XML, JSON, CSV and other formats for arrangement and concatenation. Store each generated target string in a new array or hash table, and concatenate the target strings after format conversion into documents to be translated. You can use standard text file formats (such as TXT, CSV, etc.) or formats supported by specialized translation tools (such as XLIFF, PO, etc.) for concatenation and generation. First, determine the arrangement method of the generated target string, that is, the order and concatenation method of the key and value.

[0029] It should be noted that for each key-value pair, its key and value are concatenated into a string. In order to distinguish different key-value pairs, specific separators need to be added between each key-value pair, such as commas, semicolons, tabs, etc. If a key-value pair contains special characters (such as spaces, quotation marks, etc.), it needs to be wrapped in quotation marks to avoid parsing errors.

[0030] S106 , performing document translation on the document to be translated using a language translation model to obtain a target document.

[0031] Specifically, the document is segmented and divided into sentences, and useless tags are removed. The translation direction is determined based on the language of the original document and the language of the target document. For example, if the original document is in English and the target document is in Chinese, the document needs to be translated from English to Chinese. Document translation is performed on the target document to obtain the target document.

[0032] By executing the above steps, a multilingual document is obtained, and at the same time, a string extraction is performed on the multilingual document to obtain a target string; a string segmentation process is performed on the target string to obtain multiple entries, and at the same time, data extraction is performed on the multiple entries to obtain the key value corresponding to each entry and the content value corresponding to each entry; key-value pairs are matched on the key value corresponding to each entry and the content value corresponding to each entry to obtain multiple groups of key-value pairs; a numerical matching analysis is performed on each group of key-value pairs to obtain a numerical matching analysis result, and the multiple groups of key-value pairs are corrected based on the numerical matching analysis result to obtain multiple groups of target key-value pairs; string generation is performed on the multiple groups of target key-value pairs to obtain multiple target key-value strings, and the multiple target key-value strings are format-converted to obtain a document to be translated; the document to be translated is translated using a language translation model to obtain a target document. By correcting multiple groups of key-value pairs based on the results of numerical matching analysis, multiple groups of target key-value pairs are obtained; strings are generated for the multiple groups of target key-value pairs to obtain multiple target key-value strings, and the multiple target key-value strings are formatted to obtain documents to be translated, which can avoid errors during manual processing, and by using a language translation model to translate the documents to be translated to obtain target documents, which can effectively avoid the problem of low efficiency in manual translation, so as to further improve the efficiency and accuracy of text translation of multilingual terms.

[0033] In a specific embodiment, the process of executing step S102 may specifically include the following steps:

[0034] (1) Segment the target character string using the first regular expression to obtain multiple entries;

[0035] (2) extracting key values ​​from multiple entries using a second regular expression to obtain a key value corresponding to each entry;

[0036] (3) Extract the content values ​​of multiple entries using the third regular expression to obtain the content value corresponding to each entry.

[0037] Specifically, according to the format and rules of the target string, three regular expressions are defined, which are set to segmentation, key value extraction and content value extraction respectively. The target string is segmented using the first regular expression to obtain multiple entries. Among them, the first regular expression is "**"*=", and a list or array containing multiple strings is obtained. For each entry, the second regular expression is used to extract its corresponding key value. For example, through \".*? "\\s*=key, the matching string fragment is searched and extracted, and then the key value information is extracted from the result. For each entry, the third regular expression is used to extract its corresponding content value. For example, through \\s*\".*? "s=vae, the matching string fragment is searched and extracted, and then the content value information is extracted from the result.

[0038] In a specific embodiment, the process of executing step S103 may specifically include the following steps:

[0039] (1) Encode the key value corresponding to each entry to obtain the encoding information corresponding to each entry;

[0040] (2) performing content value mapping based on the encoding information corresponding to each entry to obtain a set of to-be-matched content values ​​corresponding to each entry;

[0041] (3) Key-value pairs are matched on the content values ​​corresponding to each entry through the set of to-be-matched content values ​​corresponding to each entry, thereby obtaining multiple sets of key-value pairs.

[0042] Specifically, the key value corresponding to each entry is encoded to obtain encoding information corresponding to each entry. Specifically, when encoding using URL encoding, the character string to be encoded is first determined, which can be the entire URL address, query parameters, form data, etc. Each character to be encoded is converted into ASCII code and represented using a percent sign followed by two hexadecimal digits. For example, a space character is represented as %20. Some characters in URL addresses are reserved for special purposes, such as / , ?, and &, which require encoding to avoid confusion and parsing errors. The encoding results of each character are concatenated in their original order to obtain a complete URL encoding result. The generated URL encoding result is submitted to a data processing terminal as a query parameter or form data. For each entry, the corresponding encoding information is used as the key value to search and add the corresponding content value set to be matched in a hash table. If the key value already exists in the hash table, the content value to be matched is added to the corresponding set. Specifically, the entry to be mapped to the content value is first determined, and the corresponding encoding information and content value to be matched are obtained. A new hash table is created to store the content value set to be matched corresponding to each entry. For each entry, use its corresponding encoding information as the key value to search and add its corresponding set of content values ​​to be matched in the hash table. If the key value already exists in the hash table, the content value to be matched is added to the corresponding set. For example, dictionaries (dict) and lists (list) in Python can be used to implement hash tables and sets. For each content value to be matched, all key-value pairs contained in it are traversed and compared with the key-value pairs of the target entry in turn. The matching operation is performed on all content values ​​to be matched until all content value sets are traversed, and finally, multiple sets of key-value pairs are obtained.

[0043] In a specific embodiment, the process of executing step S104 may specifically include the following steps:

[0044] (1) performing grammatical analysis on the multiple groups of key-value pairs, determining corresponding grammatical analysis results, and performing a first correction process on the multiple groups of key-value pairs based on the grammatical analysis results to obtain multiple groups of candidate key-value pairs;

[0045] (2) Perform string length analysis on the key-value pair corresponding to each entry to determine the corresponding length analysis result;

[0046] (3) Based on the length analysis result, a second correction process is performed on the multiple groups of candidate key-value pairs using a preset string length threshold to obtain multiple groups of target key-value pairs.

[0047] Specifically, establish grammatical rules, take multiple groups of key-value pairs as input, perform grammatical analysis according to the grammatical rules, and obtain corresponding grammatical analysis results. Perform the first correction processing based on the grammatical analysis results: According to the grammatical analysis results, perform the first correction processing on multiple groups of key-value pairs, eliminate illegal key-value pair information, and generate multiple groups of candidate key-value pairs. First, determine the terms that need to be analyzed for length, and obtain their corresponding key-value pair information. Get the length of the string in the key-value pair: For each key-value pair, obtain the length of the string type key value it contains, and count the string length distribution: Count and analyze the length of the string in all key-value pairs to obtain the string length distribution, such as using histograms, scatter plots, etc. for visual display. By analyzing the string length distribution, the corresponding length analysis results, such as average length, maximum length, minimum length, etc., can be determined, and the preset string length threshold is determined, wherein the key-value pair information and screening criteria that need to be retained are determined according to the specific APP application type. For example, if you need to extract information from a specific field, you can determine a string length threshold based on the characteristics and length of that field. Before determining the preset string length threshold, you should conduct a length analysis to understand the length distribution of string-type key values ​​in the data, which can serve as a reference for setting the threshold. Adjust and optimize the preset string length threshold. For example, if the data contains outliers or extreme cases, you can adjust the threshold range appropriately. If more sophisticated processing is required, you can dynamically adjust the threshold. For each candidate key-value pair, determine whether the length of the string-type key value it contains meets the preset string length threshold. If it does not meet the threshold, the key-value pair is removed. If it does meet the threshold, the key-value pair is added to the target key-value pair set, ultimately obtaining multiple sets of target key-value pairs.

[0048] In a specific embodiment, as shown in FIG2 , the process of executing step S105 may specifically include the following steps:

[0049] S201, extracting content strings from multiple groups of target key-value pairs to obtain multiple content strings;

[0050] S202: Standardize the multiple content strings to obtain multiple standardized content strings, generate strings using the multiple standardized content strings and multiple sets of target key-value pairs to obtain multiple target key-value strings, and convert the multiple target key-value strings into different formats to obtain a document to be translated.

[0051] Specifically, content strings are extracted from multiple groups of target key-value pairs to obtain multiple content strings. For example, for a parameter of date type, strings corresponding to information such as year, month, and day can be extracted therefrom. The multiple content strings are then standardized to obtain multiple standardized content strings, and strings are generated using the multiple standardized content strings and multiple groups of target key-value pairs to obtain multiple target key-value strings. It should be noted that for the text content, non-text characters such as spaces, tabs, and carriage returns, as well as some specific words or phrases, such as stop words, are removed. For text content involving multiple character encodings, they are uniformly converted into target encodings. After completing the standardization of the content strings, multiple standardized content strings and multiple groups of target key-value pairs are used to generate strings to obtain multiple target key-value strings, and the multiple target key-value strings are format-converted to obtain the document to be translated.

[0052] In a specific embodiment, the process of executing step S106 may specifically include the following steps:

[0053] (1) Perform text cleaning on the document to be translated to obtain candidate documents;

[0054] (2) Construct a target dictionary and perform word segmentation on the candidate documents using the target dictionary to obtain multiple target word segments;

[0055] (3) Multiple target word segmentations are converted into feature vectors to obtain multiple target feature vectors;

[0056] (4) Inputting multiple target feature vectors into the language translation model to translate the document to obtain the target document.

[0057] Specifically, before analyzing and processing the document to be translated, it needs to be cleaned. Text cleaning includes removing extra spaces, special symbols and other non-text characters, as well as some meaningless words or phrases, such as stop words. In order to convert the document to be translated into meaningful paragraphs, word segmentation technology is used. For English text, it can be directly divided according to spaces, punctuation marks, etc.; for Chinese text, it is necessary to use a Chinese word segmenter (such as Jieba) for word segmentation processing to facilitate subsequent analysis and processing. After completing text cleaning and word segmentation processing, the target dictionary is constructed to achieve text classification and translation functions. The target word segmentation is converted into a numerical feature vector, and the feature vector conversion is performed using methods such as word frequency statistics or TF-IDF. By inputting the target feature vector into a trained language translation model, the automatic translation of the document to be translated is achieved.

[0058] In a specific embodiment, the process of inputting multiple target feature vectors into a language translation model to translate a document to be translated to obtain a target document includes the following steps:

[0059] (1) Inputting multiple target feature vectors into the language translation model, performing weighted averaging on the multiple target feature vectors through the language translation model to obtain the target document vector;

[0060] (2) Extract semantic features from the target document vector to obtain a semantic feature vector;

[0061] (3) Normalizing the semantic feature vector using a language translation model to obtain a normalized vector;

[0062] (4) Based on the normalized vector, the document to be translated is translated through the language translation model to obtain the target document.

[0063] Specifically, multiple target feature vectors are input into the language translation model, and the target document vector is obtained by weighted averaging. After obtaining the target document vector, the semantic feature vector of the document can be extracted by some natural language processing technologies (such as topic models, word vectors, etc.). After completing the semantic feature extraction, the semantic feature vector needs to be normalized to ensure that the weights between each semantic feature vector are equal. Normalization can be performed using methods such as standardization and maximum and minimum normalization. According to the normalized vector, the document to be translated is translated by the language translation model, and the translation result of the target document is output.

[0064] The embodiment of the present application further provides a text translation system based on multilingual terms, as shown in FIG3 , which specifically includes:

[0065] The acquisition module 301 is configured to acquire a multilingual document and, at the same time, extract a character string from the multilingual document to obtain a target character string;

[0066] The segmentation module 302 is configured to perform string segmentation processing on the target string to obtain multiple entries, and at the same time, perform data extraction on the multiple entries to obtain a key value corresponding to each entry and a content value corresponding to each entry;

[0067] Matching module 303 is configured to perform key-value pair matching on the key value corresponding to each entry and the content value corresponding to each entry to obtain multiple groups of key-value pairs;

[0068] The analysis module 304 is configured to perform a numerical matching analysis on each group of the key-value pairs to obtain a numerical matching analysis result, and perform correction processing on multiple groups of the key-value pairs based on the numerical matching analysis result to obtain multiple groups of target key-value pairs;

[0069] The generating module 305 is configured to generate character strings for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and convert the multiple target key-value character strings into different formats to obtain documents to be translated;

[0070] The translation module 306 is configured to translate the document to be translated using a language translation model to obtain a target document.

[0071] Optionally, the segmentation module 302 is specifically configured to: segment the target string using a first regular expression to obtain multiple entries; extract key values ​​from the multiple entries using a second regular expression to obtain key values ​​corresponding to each entry; and extract content values ​​from the multiple entries using a third regular expression to obtain content values ​​corresponding to each entry.

[0072] Optionally, the matching module 303 is specifically configured to: encode the key value corresponding to each of the terms to obtain the encoding information corresponding to each of the terms; perform content value mapping based on the encoding information corresponding to each of the terms to obtain a set of content values ​​to be matched corresponding to each of the terms; perform key-value pair matching on the content value corresponding to each of the terms through the set of content values ​​to be matched corresponding to each of the terms to obtain multiple groups of key-value pairs.

[0073] Optionally, the analysis module 304 is specifically configured to: perform grammatical analysis on multiple groups of the key-value pairs, determine corresponding grammatical analysis results, and perform a first correction process on the multiple groups of the key-value pairs based on the grammatical analysis results to obtain multiple groups of candidate key-value pairs; perform a string length analysis on the key-value pairs corresponding to each of the entries to determine the corresponding length analysis results; based on the length analysis results, perform a second correction process on the multiple groups of the candidate key-value pairs through a preset string length threshold to obtain multiple groups of target key-value pairs.

[0074] Optionally, the generation module 305 is specifically configured to: extract content strings from the multiple groups of target key-value pairs to obtain multiple content strings; standardize the multiple content strings to obtain multiple standardized content strings, and generate strings using the multiple standardized content strings and the multiple groups of target key-value pairs to obtain multiple target key-value strings, and convert the multiple target key-value strings into a format to obtain a document to be translated.

[0075] Optionally, the translation module 306 specifically includes:

[0076] a cleaning unit configured to perform text cleaning on the document to be translated to obtain a candidate document;

[0077] A construction unit is configured to construct a target dictionary and perform word segmentation processing on the candidate document using the target dictionary to obtain a plurality of target word segments;

[0078] A conversion unit is configured to perform feature vector conversion on a plurality of target word segments to obtain a plurality of target feature vectors;

[0079] The translation unit is configured to input the plurality of target feature vectors into the language translation model to perform document translation on the document to be translated, thereby obtaining a target document.

[0080] Optionally, the translation unit is specifically configured to: input multiple target feature vectors into the language translation model, perform weighted averaging processing on the multiple target feature vectors through the language translation model to obtain a target document vector; perform semantic feature extraction on the target document vector to obtain a semantic feature vector; perform normalization processing on the semantic feature vector through the language translation model to obtain a normalized vector; and based on the normalized vector, perform document translation on the document to be translated through the language translation model to obtain a target document.

[0081] Through the collaborative cooperation of the above modules, multilingual documents are obtained, and at the same time, character strings are extracted from the multilingual documents to obtain target character strings; character string segmentation is performed on the target character strings to obtain multiple entries, and at the same time, data extraction is performed on the multiple entries to obtain the key value corresponding to each entry and the content value corresponding to each entry; key-value pairs are matched on the key value corresponding to each entry and the content value corresponding to each entry to obtain multiple groups of key-value pairs; numerical matching analysis is performed on each group of key-value pairs to obtain numerical matching analysis results, and the multiple groups of key-value pairs are corrected based on the numerical matching analysis results to obtain multiple groups of target key-value pairs; character strings are generated for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and the multiple target key-value character strings are formatted to obtain documents to be translated; the documents to be translated are translated through the language translation model to obtain target documents. By correcting multiple groups of key-value pairs based on the results of numerical matching analysis, multiple groups of target key-value pairs are obtained; strings are generated for the multiple groups of target key-value pairs to obtain multiple target key-value strings, and the multiple target key-value strings are formatted to obtain documents to be translated, which can avoid errors during manual processing, and by using a language translation model to translate the documents to be translated to obtain target documents, which can effectively avoid the problem of low efficiency in manual translation, so as to further improve the efficiency and accuracy of text translation of multilingual terms.

[0082] The above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present application can still be modified or replaced by equivalents. Any modifications or equivalent replacements that do not depart from the spirit and scope of the present application should be included in the scope of the claims of the present application.

Claims

1. A text translation method based on multilingual terms, comprising: Acquire a multilingual document, and at the same time, extract a character string from the multilingual document to obtain a target character string; Performing string segmentation processing on the target string to obtain multiple entries, and at the same time, performing data extraction on the multiple entries to obtain a key value corresponding to each entry and a content value corresponding to each entry; Performing key-value pair matching on the key value corresponding to each of the entries and the content value corresponding to each of the entries to obtain multiple groups of key-value pairs; Performing a numerical matching analysis on each group of the key-value pairs to obtain a numerical matching analysis result, and performing correction processing on multiple groups of the key-value pairs according to the numerical matching analysis result to obtain multiple groups of target key-value pairs; Generating character strings for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and converting the multiple target key-value character strings into different formats to obtain documents to be translated; The document to be translated is translated using a language translation model to obtain a target document.

2. The text translation method based on multilingual terms according to claim 1, wherein: The step of performing string segmentation processing on the target string to obtain multiple entries, and extracting data from the multiple entries to obtain a key value corresponding to each entry and a content value corresponding to each entry includes: Segmenting the target character string using a first regular expression to obtain multiple entries; Extract key values ​​from the plurality of terms using a second regular expression to obtain a key value corresponding to each term; Content values ​​of the plurality of terms are extracted using a third regular expression to obtain a content value corresponding to each term.

3. The text translation method based on multilingual terms according to claim 1, wherein: The step of performing key-value pair matching on the key value corresponding to each of the entries and the content value corresponding to each of the entries to obtain multiple groups of key-value pairs includes: Encoding the key value corresponding to each entry to obtain encoding information corresponding to each entry; Perform content value mapping based on the encoding information corresponding to each of the terms to obtain a set of to-be-matched content values ​​corresponding to each of the terms; Key-value pairs are matched on the content values ​​corresponding to each term through the set of to-be-matched content values ​​corresponding to each term, so as to obtain multiple groups of key-value pairs.

4. The text translation method based on multilingual terms according to claim 1, wherein: The step of performing a numerical matching analysis on each group of the key-value pairs to obtain a numerical matching analysis result, and performing correction processing on multiple groups of the key-value pairs according to the numerical matching analysis result to obtain multiple groups of target key-value pairs includes: Performing grammatical analysis on the multiple groups of key-value pairs to determine corresponding grammatical analysis results, and performing a first correction process on the multiple groups of key-value pairs according to the grammatical analysis results to obtain multiple groups of candidate key-value pairs; Performing a string length analysis on the key-value pair corresponding to each of the entries to determine a corresponding length analysis result; Based on the length analysis result, a second correction process is performed on the plurality of groups of candidate key-value pairs using a preset character string length threshold to obtain a plurality of groups of target key-value pairs.

5. The text translation method based on multilingual terms according to claim 1, wherein: The step of generating character strings for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and converting the multiple target key-value character strings into different formats to obtain documents to be translated includes: Extracting content strings from the multiple groups of target key-value pairs to obtain multiple content strings; The plurality of content strings are standardized to obtain a plurality of standardized content strings, and strings are generated using the plurality of standardized content strings and a plurality of sets of target key-value pairs to obtain a plurality of target key-value strings, and the plurality of target key-value strings are format-converted to obtain a document to be translated.

6. The text translation method based on multilingual terms according to claim 1, wherein: The step of translating the document to be translated by using a language translation model to obtain a target document includes: Performing text cleaning on the document to be translated to obtain a candidate document; Constructing a target dictionary, and performing word segmentation processing on the candidate document using the target dictionary to obtain a plurality of target word segments; Performing feature vector conversion on the plurality of target word segmentations to obtain a plurality of target feature vectors; The plurality of target feature vectors are input into the language translation model to perform document translation on the document to be translated to obtain a target document.

7. The text translation method based on multilingual terms according to claim 6, wherein: The step of inputting the plurality of target feature vectors into the language translation model to translate the document to be translated to obtain a target document comprises: Inputting the plurality of target feature vectors into the language translation model, and performing weighted average processing on the plurality of target feature vectors through the language translation model to obtain a target document vector; Extracting semantic features from the target document vector to obtain a semantic feature vector; Normalizing the semantic feature vector using the language translation model to obtain a normalized vector; Based on the normalized vector, the document to be translated is translated through the language translation model to obtain a target document.

8. A text translation system based on multilingual terms, used to execute the text translation method based on multilingual terms as claimed in any one of claims 1 to 7, comprising: An acquisition module is configured to acquire a multilingual document and, at the same time, extract a character string from the multilingual document to obtain a target character string; A segmentation module is configured to perform string segmentation processing on the target string to obtain a plurality of entries, and at the same time, perform data extraction on the plurality of entries to obtain a key value corresponding to each entry and a content value corresponding to each entry; A matching module is configured to match the key value corresponding to each of the terms and the content corresponding to each of the terms The values ​​are matched in key-value pairs to obtain multiple sets of key-value pairs; An analysis module is configured to perform a numerical matching analysis on each group of the key-value pairs to obtain a numerical matching analysis result, and to perform correction processing on multiple groups of the key-value pairs according to the numerical matching analysis result to obtain multiple groups of target key-value pairs; A generating module is configured to generate character strings for the multiple groups of target key-value pairs to obtain multiple target key-value character strings, and convert the multiple target key-value character strings into different formats to obtain documents to be translated; The translation module is configured to translate the document to be translated through a language translation model to obtain a target document.

Citation Information

Patent Citations

  • Updating method and device for to-be-translated entries, equipment and medium

    CN112632212A

  • Code file generation method, computer equipment and readable storage medium

    CN113760361A

  • Software system language internationalization full-process automation method

    CN115408088A

  • Text translation method and system based on multi-language entries

    CN116522966A

  • Translation of entity names

    US20090319257A1

Cited By

  • Multi-language implementation method and system for relay protection device

    CN121070508A