Dictionary file generation method and device, equipment and storage medium

By automatically extracting keyword combinations and translation models to generate identifiers and translation comparison tables, the cumbersome problems of manually establishing identifiers and translations in the existing technology are solved, and efficient multilingual dictionary file generation is realized, which simplifies the development process and improves the efficiency.

CN119292715APending Publication Date: 2025-01-10GUANGZHOU YINGFENG NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411102257.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, developers need to manually create identifiers and translations, and manually create multilingual dictionary files, resulting in complex development processes, high complexity and low efficiency.

Method used

By obtaining the target language list and project text content, extracting the keyword combination of content to be translated based on preset filtering rules to generate identifiers, and using the preset translation model for multilingual translation, generating a translation comparison table to automatically create dictionary files for each language .

Benefits of technology

No manual translation and manual creation of dictionary files are required, which simplifies the multilingual project development process, improves development efficiency, effectively distinguishes the content to be translated and generates accurate multilingual dictionary files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292715A_ABST
    Figure CN119292715A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dictionary file generation method and device, equipment and a storage medium, and the method comprises the steps that a target language list and project text content of a first language are acquired, and the project text content comprises a plurality of text lines; extracting a keyword combination corresponding to the to-be-translated content in each text line according to a preset screening rule, and generating an identifier corresponding to the to-be-translated content based on the keyword combination; translating the target language list corresponding to the to-be-translated content of each text line based on a preset translation model to obtain a multi-language translation result; and associating the to-be-translated content in the text line, the corresponding identifier and the multi-language translation result to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table. According to the scheme, the to-be-translated contents of different text lines in the project text contents are effectively distinguished, manual translation and manual dictionary file creation are not needed, the multi-language project development process is simplified, and the project development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a dictionary file generation method, apparatus, device and storage medium. Background Art

[0002] With the popularization of the Internet and the development of globalization, more and more products and services will face the challenge of language differences when they are introduced to the global market. Taking web development as an example, developers need to adapt to the language differences in different countries and regions and develop multilingual dictionary files so that web pages can dynamically switch the displayed language according to the user's language preference or browser settings, so that users can understand and use the web page content and meet the localization needs of different regions.

[0003] However, in the related technology, developers need to manually create identifiers for project text content and translate it into other languages, and then manually create and maintain dictionary files corresponding to each language based on the translation results. The development process is complicated, the work is highly complex, and the development efficiency is low. Summary of the invention

[0004] The embodiments of the present application provide a dictionary file generation method, apparatus, device and storage medium, which solve the problem in the related art that developers need to manually establish identifiers, translate, create and maintain dictionary files corresponding to each language, resulting in complicated development processes, high work complexity and low development efficiency. The invention effectively distinguishes the contents to be translated in different text lines in the project text content, eliminates the need for manual translation and manual creation of dictionary files, simplifies the multi-language project development process and improves project development efficiency.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a dictionary file, the method comprising:

[0006] Obtaining a target language list and a project text content in a first language, wherein the project text content includes a plurality of text lines;

[0007] Extracting a keyword combination corresponding to the content to be translated in each of the text lines according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination;

[0008] Based on a preset translation model, the to-be-translated content of each of the text lines is translated into the target language list to obtain a multilingual translation result;

[0009] The content to be translated in the text line, the corresponding identifier and the multi-language translation results are associated to generate a translation comparison table, and a dictionary file corresponding to each language in the target language list is generated based on the translation comparison table.

[0010] In a second aspect, the embodiment of the present application further provides a dictionary file generating device, including:

[0011] An acquisition module configured to acquire a target language list and a project text content in a first language, wherein the project text content includes a plurality of text lines;

[0012] an identifier generation module, configured to extract a keyword combination corresponding to the content to be translated in each of the text lines according to a preset screening rule, and generate an identifier corresponding to the content to be translated based on the keyword combination;

[0013] A multilingual translation module, configured to translate the to-be-translated content of each text line into the target language list based on a preset translation model to obtain a multilingual translation result;

[0014] The dictionary file generation module is configured to associate the to-be-translated content in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generate a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0015] In a third aspect, an embodiment of the present application further provides a dictionary file generating device, the device comprising:

[0016] one or more processors;

[0017] a storage device configured to store one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the dictionary file generation method described in the embodiment of the present application.

[0019] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the dictionary file generation method described in the embodiment of the present application when executed by a computer processor.

[0020] In the embodiment of the present application, by obtaining the target language list and the project text content in the first language, the project text content includes multiple text lines; extracting the keyword combination corresponding to the content to be translated in each text line according to the preset screening rules, and generating the identifier corresponding to the content to be translated based on the keyword combination; translating the content to be translated in each text line corresponding to the target language list based on the preset translation model to obtain a multilingual translation result; associating the content to be translated in the text line, the corresponding identifier and the multilingual translation result to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table. In the above scheme, by generating an identifier based on the keyword combination corresponding to the content to be translated in each text line, the content to be translated can be effectively combined with the content characteristics of the content to be translated to generate a unique identification for the content to be translated, while improving the recognition of the identifier, it is conducive to distinguishing the content to be translated in different text lines in the project text content; by associating the content to be translated, the corresponding identifier and the multilingual translation result to generate a translation comparison table, it can provide basic reference data for generating dictionary files in different languages, and finally generate a dictionary file corresponding to each language in the target language list based on the translation comparison table, without manual translation and manual creation of dictionary files, simplifying the multilingual project development process and improving project development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a dictionary file generation method provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of a dictionary file generation method including extracting keyword combinations corresponding to content to be translated provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of a dictionary file generation method including a process of generating an identifier corresponding to content to be translated provided in an embodiment of the present application;

[0024] Figure 4 A flowchart of another dictionary file generation method including a process of generating an identifier corresponding to content to be translated provided in an embodiment of the present application;

[0025] Figure 5 A flowchart of a dictionary file generation method including a process of generating a dictionary file based on a manual proofreading version provided in an embodiment of the present application;

[0026] Figure 6 A flowchart of a dictionary file generation method including a process of optimizing and updating a manual proofreading version provided in an embodiment of the present application;

[0027] Figure 7A flowchart of a dictionary file generation method including a process of checking whether an identifier conforms to an existing association relationship provided in an embodiment of the present application;

[0028] Figure 8 A structural block diagram of a dictionary file generating device provided in an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of the structure of a dictionary file generating device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The dictionary file generation method provided in the embodiment of the present application is used to generate multilingual dictionary files required for business projects to meet the localization requirements of different regions. Relevant application scenarios may include web development, game development, application development, etc. The several application scenarios listed above are only exemplary and explanatory. In actual applications, the dictionary file generation method can also be used in project development in other scenarios, and the embodiment of the present application does not limit this. The present application aims to provide a dictionary file generation method, device, equipment and storage medium to solve the problem that developers in the related technology need to manually establish identifiers, translate, and create and maintain dictionary files corresponding to each language, making the development process complicated, the work complexity high, and the development efficiency low.

[0033] In the dictionary file generation method provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.

[0034] Figure 1 The flowchart of a dictionary file generation method provided in an embodiment of the present application can be implemented with a dictionary file generation device as the execution subject. Figure 1 As shown, the dictionary file generation method specifically includes the following steps:

[0035] Step S101: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0036] Among them, the project text content can be the product team or the demand side according to the project requirements, sorting and submitting the initial prototype document content, the project text content includes multiple text lines, each text line records the text content that needs to be translated, and the text content is the first language. The target language list can be other languages ​​that need to be translated for the current development project defined by the product team or the demand side. Taking web development as an example, the project text content can be a web page title, web page content elements, web page operation elements, etc. For example, the text line can record "Welcome to XXX website", "login account", "login password", "download link", etc. Of course, the above is only an exemplary description, and the developer can set the project text content and the specific content of the target language list according to the actual needs of different development projects, which is not limited in this application.

[0037] Step S102: extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination.

[0038] Among them, the preset screening rule can be a judgment condition predefined by the developer for determining the keywords in the content to be translated, and the keyword combination can be used to characterize the content characteristics of the content to be translated. In one embodiment, for projects involving more descriptive content such as character actions, the preset screening rule can be based on grammatical rules to filter out the words that meet the subject component, predicate component or object component from the content to be translated to obtain the keyword combination. In one embodiment, for projects with strong professionalism, the preset screening rule can be to filter out professional terms from the content to be translated to obtain the keyword combination by querying the term library based on the current business settings. In one embodiment, for projects with strong content themes, the preset screening rule can be to calculate the similarity between the two words in the content to be translated, and use several words within the preset threshold range as the keyword combination. Of course, the developer can formulate appropriate preset screening rules according to the text content characteristics of the actual development project, which is not limited in this application. Among them, the identifier can be used as the index information of the content to be translated. In one embodiment, the keyword combination can be converted into a vector representation, and the identifier of the content to be translated in each text line can be generated by semantic hash calculation. In one embodiment, a random rule can be set to extract a preset position or a preset number of coded characters from each keyword in the keyword combination, and the combination is used to obtain an identifier of the content to be translated. Of course, the developer can also set other methods of generating corresponding identifiers based on the keyword combination to ensure that the content to be translated in each text line can be uniquely identified, which is not limited in this application.

[0039] Step S103: translating the to-be-translated content of each text line into the target language list based on a preset translation model to obtain a multi-language translation result.

[0040] Among them, the preset translation model can be a pre-trained open source translation model, for example, a Seamless Communication model, a GPT model, etc., which is not limited in this application. In one embodiment, the preset translation model can be trained based on a multilingual training set so that the preset translation model supports translation tasks in multiple languages. By inputting the content to be translated and the target language into the preset translation model, the corresponding translation result can be obtained. In one embodiment, the translation model can be trained based on the training set corresponding to each target language to obtain a preset translation model corresponding to each voice. By inputting the content to be translated into the preset translation model corresponding to the target language, the translation result corresponding to the target language can be obtained.

[0041] Step S104: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0042] Wherein, the translation comparison table can be associated and bound with each content to be translated, the corresponding identifier and the multilingual translation result. The identifier can be used as an index to locate the content to be translated and the corresponding multilingual translation result, for example, identifier 1-content to be translated-A language translation result-B language translation result-... In one embodiment, the translation comparison table can be split into a plurality of to-be-processed files in different languages, each file records the identifier and the text content of the corresponding language, for example, Chinese files, English files, etc. can be split, and corresponding dictionary files are generated respectively. In one embodiment, the identifier and the text content corresponding to the target voice can be extracted from the translation comparison table to generate the dictionary file. The dictionary file can be a file for storing and managing dictionary data, which is used to provide a structured data storage and indexing method for program development. In one embodiment, the dump() function in the json module can be used to write the text data in the translation comparison table into a JSON file to obtain a corresponding dictionary file. In one embodiment, the DictWriter class in the csv module can be used to write the dictionary data in the translation comparison table into a CSV file to obtain a corresponding dictionary file. Of course, developers can select a suitable dictionary file format according to the development environment and platform requirements of the actual application scenario, which is not limited in this application.

[0043] In the above, by obtaining the target language list and the project text content in the first language, the project text content includes multiple text lines; extracting the keyword combination corresponding to the content to be translated in each text line according to the preset screening rules, and generating the identifier corresponding to the content to be translated based on the keyword combination; translating the content to be translated in each text line corresponding to the target language list based on the preset translation model to obtain the multi-language translation result; associating the content to be translated in the text line, the corresponding identifier and the multi-language translation result to generate a translation comparison table, and generating the dictionary file corresponding to each language in the target language list based on the translation comparison table. In the above scheme, by generating the identifier based on the keyword combination corresponding to the content to be translated in each text line, the content characteristics of the content to be translated can be effectively combined to generate a unique identification for the content to be translated, which improves the recognition of the identifier and is conducive to distinguishing the content to be translated in different text lines in the project text content; by associating the content to be translated, the corresponding identifier and the multi-language translation result to generate a translation comparison table, it can provide basic reference data for generating dictionary files in different languages, and finally generate the dictionary file corresponding to each language in the target language list based on the translation comparison table, without the need for manual translation and manual creation of dictionary files, simplifying the multi-language project development process and improving project development efficiency.

[0044] Figure 2A flowchart of a method for generating a dictionary file including extracting keyword combinations corresponding to content to be translated is provided in an embodiment of the present application. Figure 2 As shown, the dictionary file generation method specifically includes the following steps:

[0045] Step S201: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0046] Step S202: Segment the content to be translated in each text line into word units, and mark the part of speech of each word unit.

[0047] Among them, the word segmentation process can be to divide the content to be translated into independent word units. In one embodiment, the language of the content to be translated is Chinese, and the content to be translated can be matched with the entries in the preset dictionary library. If there is a Chinese character string that is the same as the target entry in the preset dictionary library, the match is successful, a word unit is identified, and the word unit is tagged with the part of speech according to the part of speech of the target entry. Then, according to the different scanning directions, it can be divided into forward matching and reverse matching, and according to different length priority matching, it can be divided into maximum matching and minimum matching until the word segmentation of the content to be translated is completed. In one embodiment, pre-trained models such as SqueezeBERT and ALBERT can be used as feature extractors, combined with sequence annotation models such as hidden Markov models HMM and conditional random fields CRF for word segmentation, and the corresponding parts of speech are marked.

[0048] Step S203: Determine a keyword combination that meets the preset screening condition from the word units corresponding to each text line according to the part of speech and the preset syntactic structure.

[0049] Among them, in one embodiment, it is possible to match the content to be translated based on a preset syntactic structure to determine the sentence components corresponding to the word unit, for example, a subject-predicate-object structure, etc. In one embodiment, the word units in the content to be translated can be analyzed for sentence components through pre-trained language models such as BERT and GPT, and the word units that meet the preset syntactic structure can be selected. The preset screening condition can be used to screen out word units that meet preset parts of speech and preset sentence components. For example, the preset screening condition can be that the keyword is a noun or a verb, and its sentence component is one of a subject, a predicate, or an object. Of course, developers can also set other preset screening conditions according to the grammatical structure characteristics of the content to be translated in the actual application scenario, adapted to the different content characteristics of the content to be translated, which is not limited in this application.

[0050] Step S204: Generate an identifier corresponding to the content to be translated based on the keyword combination.

[0051] Step S205: translating the to-be-translated content of each text line into the target language list based on a preset translation model to obtain a multi-language translation result.

[0052] Step S206: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0053] As described above, by using the word segmentation and annotation results of the translated content and the preset syntactic structure, the semantic information of the content to be translated can be effectively collected, and the keyword combination that fits the content characteristics of the content to be translated can be screened out, thereby improving the recognition of the subsequently generated identifiers.

[0054] Figure 3 A flowchart of a dictionary file generation method including a process of generating an identifier corresponding to content to be translated is provided in an embodiment of the present application. Figure 3 As shown, the dictionary file generation method specifically includes the following steps:

[0055] Step S301: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0056] Step S302: extracting keyword combinations corresponding to the content to be translated in each text line according to preset screening rules.

[0057] Step S303: Map and transform each keyword in the keyword combination to obtain a corresponding word vector.

[0058] Among them, each keyword can be converted into a vector representation through word embedding methods such as Word2Vec and GloVe, and unstructured data can be converted into a fixed-size vector, which can be suitable for subsequent semantic hash calculation processing.

[0059] Step S304: Aggregate the word vectors corresponding to the keywords to obtain the target word vectors.

[0060] The aggregation process may be to fuse the word vectors corresponding to all keywords by averaging, weighted summing, etc., to obtain a target word vector representing the keyword combination.

[0061] Step S305: Perform semantic hash calculation on the target word vector to obtain an identifier corresponding to the content to be translated.

[0062] The semantic hash calculation can convert the target word vector into a fixed-length binary string based on a local sensitive hashing algorithm, a spectral hashing algorithm, etc. The binary string can be used as a unique identifier for the content to be translated. The semantic hashing algorithm can maintain the semantic similarity of the original space vector as much as possible.

[0063] Step S306: Based on the preset translation model, the content to be translated in each text line is translated into the target language list to obtain a multi-language translation result.

[0064] Step S307: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0065] As mentioned above, by converting the keyword combination into a target word vector and performing semantic hash calculation on the target word vector to obtain an identifier corresponding to the content to be translated, on the one hand, the uniqueness of the identifier of the content to be translated can be guaranteed, and on the other hand, the identifier can be used to retain the semantic similarity between the content to be translated, which is beneficial to content retrieval and maintenance in subsequent project development.

[0066] Figure 4 A flowchart of another method for generating a dictionary file including a process for generating an identifier corresponding to content to be translated provided in an embodiment of the present application. Figure 4 As shown, the dictionary file generation method specifically includes the following steps:

[0067] Step S401: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0068] Step S402: extracting keyword combinations corresponding to the content to be translated in each text line according to preset screening rules.

[0069] Step S403: Map and transform each keyword in the keyword combination to obtain a corresponding word vector.

[0070] Step S404: Aggregate the word vectors corresponding to the keywords to obtain the target word vectors.

[0071] Step S405: Perform semantic hash calculation on the target word vector to obtain an identifier corresponding to the content to be translated.

[0072] Step S406: Look up the classification code corresponding to each keyword in the keyword combination from the preset comparison table.

[0073] The preset comparison table may record the result of classifying the project text content according to different subject contents in units of words, and a classification code is set corresponding to the category to which each word belongs. Taking the development of web pages as an example, the set categories may be web page navigation, web page menu, etc., and the specific classification code may be obtained by combining one or more types of characters such as numbers and letters, for example, a01, b01, etc., which is not limited in this application.

[0074] Step S407: Concatenate the classification code and identifier corresponding to each keyword to obtain a target identifier.

[0075] Among them, the identifier obtained by semantic hash calculation and the classification codes corresponding to all keywords can be spliced ​​to obtain the target identifier. For example, the identifier is 10011010, and the classification codes corresponding to the keywords are a01 and c01, then the corresponding target identifier can be 10011010-a01-c01.

[0076] Step S408: translating the to-be-translated content of each text line into the target language list based on the preset translation model to obtain a multi-language translation result.

[0077] Step S409: Associating the content to be translated in the text line, the corresponding target identifier and the multi-language translation results to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0078] As mentioned above, the identifier obtained by semantic hash calculation is concatenated with the classification code corresponding to the keyword to obtain the target identifier, which can add category information to the identifier corresponding to the content to be translated, facilitate the positioning of the same category of content to be translated for subsequent project development, and enrich the index feature information corresponding to the content to be translated.

[0079] Figure 5 A flowchart of a dictionary file generation method including a process of generating a dictionary file based on a manual proofreading version is provided in an embodiment of the present application. Figure 5 As shown, the dictionary file generation method specifically includes the following steps:

[0080] Step S501: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0081] Step S502: extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination.

[0082] Step S503: Based on a preset translation model, the content to be translated in each text line is translated into the target language list to obtain a multi-language translation result.

[0083] Step S504: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table.

[0084] Step S505: Send the translation comparison table to the development end, so that the development end provides a manual proofreading entry for the translation comparison table in the interactive interface, and feeds back a proofreading completion mark when detecting that there is a manual proofreading version corresponding to the translation comparison table.

[0085] Among them, the development end can be a local device end that provides a development environment for project development to developers, and developers can perform relevant operations for project development through an interactive interface at the development end. For example, after the server generates a translation comparison table, the translation comparison table can be sent to the development end, and the development end can provide a manual proofreading entrance for the translation comparison table in the interactive interface. The developer can download the translation comparison table through the manual proofreading entrance, and submit the manual proofreading version of the translation comparison table after completing the manual proofreading that conforms to the context and language habits. Therefore, when the development end detects that there is a manual proofreading version corresponding to the translation comparison table, it means that the developer has completed the manual proofreading of the translation comparison table. The development end can feedback a proofreading completion mark to the server to notify the server that the translation comparison table has generated a corresponding manual proofreading version.

[0086] Step S506: When the proofreading completion mark is detected, obtain the manually proofread version.

[0087] Among them, since the time for developers to complete manual proofreading is flexible, the server can be set to regularly detect whether a proofreading completion mark is received. When the proofreading completion mark is detected, the server can actively request the developer to obtain the manual proofreading version.

[0088] Step S507: Generate a dictionary file corresponding to each language in the target language list based on the manually proofread version.

[0089] As mentioned above, by adding a manual proofreading process to the translation comparison table, it can provide a strong guarantee for improving the translation quality of the translation comparison table, further reduce the problems of inaccurate translation, grammatical errors or inconsistency with the context that may occur in machine translation, and provide more accurate translation results for project development.

[0090] Figure 6 A flowchart of a dictionary file generation method including a process of optimizing and updating a manual proofreading version is provided in an embodiment of the present application. Figure 6 As shown, the dictionary file generation method specifically includes the following steps:

[0091] Step S601: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0092] Step S602: extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination.

[0093] Step S603: Based on a preset translation model, the content to be translated in each text line is translated into the target language list to obtain a multi-language translation result.

[0094] Step S604: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table.

[0095] Step S605: Send the translation comparison table to the development end, so that the development end provides a manual proofreading entry for the translation comparison table in the interactive interface, and feeds back a proofreading completion mark when detecting the existence of a manual proofreading version corresponding to the translation comparison table.

[0096] Step S606: When the proofreading completion mark is detected, obtain the manually proofread version.

[0097] Step S607: Filter out key terms from the multilingual translation results in the manually proofread version according to the preset vocabulary library, and determine candidate terms whose similarity with the key terms meets a preset threshold.

[0098] Among them, the preset vocabulary library can record professional terms associated with the current development project. By performing a vocabulary comparison between the multilingual translation results and the preset vocabulary library, the key terms located in the preset vocabulary library can be determined from the multilingual translation results. In one embodiment, the preset vocabulary library can be a semantic dictionary that organizes the concepts of words in a tree or mesh structure, and the similarity between the key terms and other terms in the dictionary is calculated by calculating the positional relationship between the key terms and other terms in the dictionary, such as the shortest path length. In one embodiment, the word vectors corresponding to the key terms and other terms can be obtained from the preset vocabulary library, and the similarity between the word vectors is calculated. In addition, the preset threshold can be used to determine candidate terms that are relatively close to the key terms, which can be adaptively set by the developer according to actual optimization needs, and this application is not limited here.

[0099] Step S608: replace the key terms with the candidate terms in the multilingual translation results to obtain candidate translation results, and calculate the first matching degree and the second matching degree respectively between the content to be translated in the manual proofreading version and the multilingual translation results and the candidate translation results.

[0100] The first matching degree and the second matching degree may be obtained based on calculating one or more of the BLEU index, the TER index, the METEOR index, etc. In one embodiment, the index value of one of the BLEU index, the TER index, the METEOR index, etc. may be used as the matching degree. In one embodiment, the weighted sum of the index values ​​obtained by respectively calculating the BLEU index, the TER index, and the METEOR index may be used as the matching degree.

[0101] Step S609: When the first matching degree is less than the second matching degree, a language optimization suggestion for a manually proofread version is generated based on the candidate translation results.

[0102] Among them, when the first matching degree is less than the second matching degree, it can be regarded that the term translation result of the candidate translation result is better than the original multilingual translation result. Therefore, a language optimization suggestion of replacing the key terms whose matching degree does not meet the expectations with the candidate terms can be put forward for reference by developers.

[0103] Step S610: Feedback the language optimization suggestion to the development end, so that the development end displays the language optimization suggestion on the interactive interface and provides an update entry for the manual proofreading version, and feeds back a proofreading update mark when an update of the manual proofreading version is detected.

[0104] Among them, developers can view language optimization suggestions through the interactive interface, and refer to the language optimization suggestions to determine whether to update the manual proofreading version. If the developer changes the submitted manual proofreading version through the update entrance, the development end can check the latest modification date of the manual proofreading version or set an update prompt to achieve the purpose of detecting whether the manual proofreading version has been updated. Therefore, when the development end detects that the manual proofreading version has been updated, it means that the developer has accepted the language optimization suggestions and changed the manual proofreading version. The development end can feedback the proofreading update flag to the server to notify the server that the manual proofreading version has been updated.

[0105] Step S611: When a proofreading update mark is detected, an updated manual proofreading version is obtained.

[0106] Among them, since the developer has a flexible time to update the manual proofreading version, the server can set a timer to detect whether the proofreading update mark is received within a limited period. When the proofreading update mark is detected, the server can actively request the developer to obtain the updated manual proofreading version.

[0107] Step S612: Generate a dictionary file corresponding to each language in the target language list based on the updated manually proofread version.

[0108] As mentioned above, by adding the optimization and update process of the manually proofread version, it is helpful to improve the quality of the terminology translation of the manually proofread version, enhance the accuracy of the terminology translation corresponding to the content to be translated, provide more accurate terminology translation results for project development, and adapt to application scenarios with strong professional requirements.

[0109] Figure 7 A flowchart of a dictionary file generation method including a process of checking whether an identifier conforms to an existing association relationship is provided in an embodiment of the present application. Figure 7 As shown, the dictionary file generation method specifically includes the following steps:

[0110] Step S701: Obtain a target language list and a project text content in a first language, where the project text content includes a plurality of text lines.

[0111] Step S702: extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination.

[0112] Step S703: Based on a preset translation model, the content to be translated in each text line is translated into the target language list to obtain a multi-language translation result.

[0113] Step S704: Associating the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table.

[0114] Step S705: Send the translation comparison table to the development end, so that the development end provides a manual proofreading entry for the translation comparison table in the interactive interface, and feeds back a proofreading completion mark when detecting the existence of a manual proofreading version corresponding to the translation comparison table.

[0115] Step S706: When the proofreading completion mark is detected, obtain the manually proofread version.

[0116] Step S707: Check whether the identifier of each text line in the manually proofread version and the content to be translated conform to the existing association relationship in the translation comparison table.

[0117] Among them, since abnormal situations such as mis-modification of identifiers and disorder of identifiers may occur during manual proofreading, the manual proofreading version can be checked to determine whether the identifier and the content to be translated are consistent with the existing association relationship in the original translation comparison table, and the existing association relationship can be the unique binding relationship between the content to be translated and the identifier. If the identifiers corresponding to the same content to be translated are different, it can be considered that it does not meet the existing association relationship. If the identifiers corresponding to the content to be translated in the manual proofreading version and the translation comparison table are the same, it can be considered that it meets the existing association relationship.

[0118] Step S708: When it is detected that the identifier of each text line and the content to be translated conform to the existing association relationship in the translation comparison table, a dictionary file corresponding to each language in the target language list is generated based on the manual proofreading version.

[0119] As mentioned above, by checking whether the content to be translated and the identifier in the manual proofreading version conform to the existing association relationship, it is possible to effectively determine whether an error occurs in the manual proofreading process. When it is determined that the existing association relationship is conformed, a dictionary file is generated based on the manual proofreading version, which can ensure the accuracy of the identifier in the dictionary file and is conducive to the retrieval positioning and maintenance of subsequent project development.

[0120] Figure 8 This is a structural block diagram of a dictionary file generation device provided in an embodiment of the present application. The device is configured to execute the dictionary file generation method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 8 As shown, the device specifically includes:

[0121] An acquisition module 101 is configured to acquire a target language list and a project text content in a first language, wherein the project text content includes a plurality of text lines;

[0122] The identifier generation module 102 is configured to extract the keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generate an identifier corresponding to the content to be translated based on the keyword combination;

[0123] The multilingual translation module 103 is configured to translate the to-be-translated content of each text line into a target language list based on a preset translation model to obtain a multilingual translation result;

[0124] The dictionary file generation module 104 is configured to associate the content to be translated in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generate a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0125] In the above, by obtaining the target language list and the project text content in the first language, the project text content includes multiple text lines; extracting the keyword combination corresponding to the content to be translated in each text line according to the preset screening rules, and generating the identifier corresponding to the content to be translated based on the keyword combination; translating the content to be translated in each text line corresponding to the target language list based on the preset translation model to obtain the multi-language translation result; associating the content to be translated in the text line, the corresponding identifier and the multi-language translation result to generate a translation comparison table, and generating the dictionary file corresponding to each language in the target language list based on the translation comparison table. In the above scheme, by generating the identifier based on the keyword combination corresponding to the content to be translated in each text line, the content characteristics of the content to be translated can be effectively combined to generate a unique identification for the content to be translated, which improves the recognition of the identifier and is conducive to distinguishing the content to be translated in different text lines in the project text content; by associating the content to be translated, the corresponding identifier and the multi-language translation result to generate a translation comparison table, it can provide basic reference data for generating dictionary files in different languages, and finally generate the dictionary file corresponding to each language in the target language list based on the translation comparison table, without the need for manual translation and manual creation of dictionary files, simplifying the multi-language project development process and improving project development efficiency.

[0126] In a possible embodiment, the identifier generation module 102 is further configured to:

[0127] Segment the content to be translated in each text line to obtain word units, and mark the part of speech of each word unit;

[0128] According to the part of speech and the preset syntactic structure, a keyword combination that meets the preset screening conditions is determined from the word units corresponding to each text line.

[0129] In a possible embodiment, the identifier generation module 102 is further configured to:

[0130] Map each keyword in the keyword combination to obtain the corresponding word vector;

[0131] Aggregate the word vectors corresponding to the keywords to obtain the target word vector;

[0132] Perform semantic hash calculation on the target word vector to obtain the identifier corresponding to the content to be translated.

[0133] In a possible embodiment, it further includes a second identifier generating module configured to:

[0134] Query the classification code corresponding to each keyword in the keyword combination from the preset comparison table;

[0135] Concatenate the classification code and identifier corresponding to each keyword to obtain the target identifier;

[0136] Correspondingly, the dictionary file generating module 104 is further configured as follows:

[0137] The content to be translated in the text line, the corresponding target identifier and the multilingual translation results are associated to generate a translation comparison table.

[0138] In a possible embodiment, a manual proofreading module is further included, configured as follows:

[0139] The translation comparison table is sent to the development end, so that the development end provides a manual proofreading entry for the translation comparison table in the interactive interface, and when a manual proofreading version corresponding to the translation comparison table is detected, a proofreading completion mark is fed back;

[0140] When a proofreading completion mark is detected, a manually proofread version is obtained;

[0141] Correspondingly, the dictionary file generating module 104 is further configured as follows:

[0142] Generate dictionary files corresponding to each language in the target language list based on the manually proofread version.

[0143] In a possible embodiment, it further includes an optimization update module configured as follows:

[0144] Filter out key terms from the multilingual translation results in the manually proofread version according to a preset vocabulary library, and determine candidate terms whose similarity with the key terms meets a preset threshold;

[0145] In the multilingual translation results, the key terms are replaced with the candidate terms to obtain the candidate translation results, and the to-be-translated content in the manual proofreading version is respectively calculated with the multilingual translation results and the candidate translation results to obtain a first matching degree and a second matching degree;

[0146] When the first matching degree is less than the second matching degree, generating a language optimization suggestion for a manually proofread version based on the candidate translation result;

[0147] Feedback language optimization suggestions to the development side, so that the development side can display language optimization suggestions on the interactive interface and provide an update entry for the manual proofreading version, and feedback the proofreading update mark when it is detected that the manual proofreading version has been updated;

[0148] When a proofreading update flag is detected, obtaining an updated manual proofreading version;

[0149] Correspondingly, the dictionary file generating module 104 is further configured as follows:

[0150] Generate a dictionary file corresponding to each language in the target language list based on the updated manual proofreading version.

[0151] In a possible embodiment, an identifier checking module is further included, configured to:

[0152] Check whether the identifier of each text line in the manual proofreading and the content to be translated conform to the existing association relationship in the translation comparison table;

[0153] Accordingly, the dictionary file generating module 104 is further configured as follows:

[0154] When it is detected that the identifier of each text line and the content to be translated conform to the existing association relationship in the translation comparison table, a dictionary file corresponding to each language in the target language list is generated based on the manual proofreading version.

[0155] Fig. 9 A schematic diagram of a dictionary file generating device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Fig. 9 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Fig. 9 The example of connecting via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the dictionary file generation method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned dictionary file generation method. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.

[0156] The dictionary file generating device provided above can be used to execute the dictionary file generating method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0157] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a dictionary file generation method described in the above embodiment, which includes: obtaining a target language list and project text content in a first language, the project text content including multiple text lines; extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination; translating the content to be translated in each text line corresponding to the target language list based on a preset translation model to obtain a multi-language translation result; associating the content to be translated in the text line, the corresponding identifier and the multi-language translation result to generate a translation comparison table, and generating a dictionary file corresponding to each language in the target language list based on the translation comparison table.

[0158] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.

[0159] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present application are not limited to the above dictionary file generation method, and can also execute related operations in the dictionary file generation method provided in any embodiment of the present application.

[0160] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text when describing is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (fl ash RAM). The memory is an example of a computer-readable medium.

[0161] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0162] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for generating a dictionary file, characterized in that: include: Obtaining a target language list and a project text content in a first language, wherein the project text content includes a plurality of text lines; Extracting a keyword combination corresponding to the content to be translated in each of the text lines according to a preset screening rule, and generating an identifier corresponding to the content to be translated based on the keyword combination; Based on a preset translation model, the to-be-translated content of each of the text lines is translated into the target language list to obtain a multilingual translation result; The content to be translated in the text line, the corresponding identifier and the multi-language translation results are associated to generate a translation comparison table, and a dictionary file corresponding to each language in the target language list is generated based on the translation comparison table.

2. The dictionary file generation method according to claim 1, characterized in that: The step of extracting a keyword combination corresponding to the content to be translated in each text line according to a preset screening rule includes: Segmenting the content to be translated in each of the text lines to obtain word units, and marking the part of speech of each of the word units; According to the part of speech and the preset syntactic structure, a keyword combination that meets the preset screening condition is determined from the word units corresponding to each of the text lines.

3. The dictionary file generating method according to claim 1, characterized in that: The step of generating an identifier corresponding to the content to be translated based on the keyword combination includes: Mapping and transforming each keyword in the keyword combination to obtain a corresponding word vector; Aggregate the word vectors corresponding to the keywords to obtain the target word vector; A semantic hash calculation is performed on the target word vector to obtain an identifier corresponding to the content to be translated.

4. The dictionary file generating method according to claim 3, characterized in that: After performing semantic hash calculation on the target word vector to obtain the identifier corresponding to the content to be translated, the method further includes: Querying a preset comparison table for a classification code corresponding to each keyword in the keyword combination; Concatenate the classification code corresponding to each keyword and the identifier to obtain a target identifier; Accordingly, the step of associating the content to be translated in the text line, the corresponding identifier and the multilingual translation result to generate a translation comparison table includes: The content to be translated in the text line, the corresponding target identifier and the multilingual translation results are associated to generate a translation comparison table.

5. The dictionary file generating method according to claim 1, characterized in that: After associating the to-be-translated content in the text line, the corresponding identifier and the multi-language translation result to generate a translation comparison table, the method further includes: Sending the translation comparison table to the development end, so that the development end provides a manual proofreading entry for the translation comparison table in an interactive interface, and feeding back a proofreading completion mark when detecting the existence of a manual proofreading version corresponding to the translation comparison table; When the proofreading completion mark is detected, obtaining the manually proofread version; Accordingly, generating a dictionary file corresponding to each language in the target language list based on the translation comparison table includes: A dictionary file corresponding to each language in the target language list is generated based on the manually proofread version.

6. The dictionary file generating method according to claim 5, characterized in that: After obtaining the manual proofreading version, the method further includes: Screening out key terms from the multilingual translation results in the manually proofread version according to a preset vocabulary library, and determining candidate terms whose similarity with the key terms meets a preset threshold; The key term is replaced with the candidate term in the multilingual translation result to obtain a candidate translation result, and the content to be translated in the manual proofreading version is respectively calculated with the multilingual translation result and the candidate translation result to obtain a first matching degree and a second matching degree; When the first matching degree is less than the second matching degree, generating a language optimization suggestion for the manually proofread version based on the candidate translation result; Feeding back the language optimization suggestion to the development end, so that the development end displays the language optimization suggestion on the interactive interface and provides an update entry for the manual proofreading version, and feeding back a proofreading update mark when detecting that the manual proofreading version is updated; When the proofreading update mark is detected, obtaining the updated manual proofreading version; Accordingly, generating a dictionary file corresponding to each language in the target language list based on the manually proofread version includes: A dictionary file corresponding to each language in the target language list is generated based on the updated manual proofreading version.

7. The method for generating a dictionary file according to claim 5, characterized in that: After obtaining the manual proofreading version, the method further includes: Checking whether the identifier of each text line in the manual proofreading version and the content to be translated conform to the existing association relationship in the translation comparison table; Accordingly, generating a dictionary file corresponding to each language in the target language list based on the manually proofread version includes: When it is detected that the identifier of each text line and the content to be translated conform to the existing association relationship in the translation comparison table, a dictionary file corresponding to each language in the target language list is generated based on the manual proofreading version.

8. A dictionary file generating device, characterized in that: include: An acquisition module configured to acquire a target language list and a project text content in a first language, wherein the project text content includes a plurality of text lines; an identifier generation module, configured to extract a keyword combination corresponding to the content to be translated in each of the text lines according to a preset screening rule, and generate an identifier corresponding to the content to be translated based on the keyword combination; A multilingual translation module, configured to translate the to-be-translated content of each text line into the target language list based on a preset translation model to obtain a multilingual translation result; The dictionary file generation module is configured to associate the to-be-translated content in the text line, the corresponding identifier and the multi-language translation results to generate a translation comparison table, and generate a dictionary file corresponding to each language in the target language list based on the translation comparison table.

9. A dictionary file generating device, the device comprising: one or more processors; The storage device is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the dictionary file generation method according to any one of claims 1 to 7.

10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the dictionary file generation method according to any one of claims 1 to 7 when executed by a computer processor.

Citation Information

Cited By

  • Automatic file data cleaning method of file system

    CN120610951A