Translation method and device based on language translation model

By loading preset translation plug-ins and language translation models in the target medical equipment, automatic translation in multiple languages ​​is realized, solving the problems of heavy manual translation load and high error rate in traditional translation methods, and improving translation efficiency and user experience.

CN119538947APending Publication Date: 2025-02-28上海融易迈医疗健康科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411677971.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The traditional Qt multilingual translation method requires engineers to manually edit the translation content of each language, resulting in large workloads and heavy non-professional workloads, prone to human errors, affecting the quality of translation and development efficiency.

Method used

Using a translation method based on the language translation model, the text to be translated in the target medical device is automatically translated by loading preset translation plug-ins and trained language translation models, supporting multiple language conversions, and displaying the translation results in the device's display interface.

Benefits of technology

It realizes automatic conversion in multiple languages, improves translation efficiency, reduces the time and cost of manual translation, ensures the automation and efficiency of the translation process, and improves the user experience and the international adaptability of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538947A_ABST
    Figure CN119538947A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a translation method and device based on a language translation model.The method comprises the steps that in target medical equipment, a preset translation plug-in is loaded, and the preset translation plug-in is used for conversion of multiple languages; running the preset translation plug-in, and translating a to-be-translated text in the target medical equipment to obtain a target language text; and displaying the target language text in a display interface corresponding to the target medical equipment. According to the method, the preset translation plug-in is loaded in the target medical equipment, automatic conversion of multiple languages can be realized, the translation efficiency is greatly improved, the time and the cost of manual translation are reduced, and the to-be-translated text in the target medical equipment is translated by running the preset translation plug-in, so that the translation efficiency of the to-be-translated text in the target medical equipment is improved. The text can be quickly and accurately converted into the target language text, it is ensured that a user can operate and understand the text through a native language or a familiar language, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a translation method and device based on a language translation model. Background Art

[0002] With the development of globalization and the expansion of international markets, multi-language support for software applications has become increasingly important. As a widely used cross-platform application development framework, Qt's multi-language translation (internationalization) function plays an important role in software development. The traditional Qt multi-language translation process includes the following steps: First, use the lupdate tool to generate a ts (Translation Source) file based on the strings marked in the source code; then, manually edit the ts file through the Qt Linguist tool and translate it into different languages; finally, use the lrelease tool to publish the generated qm translation file and load this qm (Qt Message) translation file in the code.

[0003] However, this traditional multi-language translation method has significant shortcomings. Engineers need to manually edit the translation content of each language in the Qt Linguist tool, which not only increases the workload, but also brings a lot of non-professional work burden. Especially when it is necessary to support multiple languages, each language needs to be translated and edited separately, resulting in an exponential increase in the translation load of engineers. These tedious translation tasks are not only time-consuming and labor-intensive, but also prone to human errors, affecting translation quality and development efficiency. Summary of the invention

[0004] One purpose of the embodiments of the present invention is to provide a translation method and device based on a language translation model, which is used to solve the technical problems of heavy translation load and high human error rate in traditional multilingual translation methods, which affect translation quality and development efficiency.

[0005] In a first aspect, an embodiment of the present invention provides a translation method based on a language translation model, the method comprising:

[0006] In the target medical device, a preset translation plug-in is loaded, wherein the preset translation plug-in is used for conversion between multiple languages;

[0007] Running the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language;

[0008] The target language text is displayed in a display interface corresponding to the target medical device.

[0009] In a possible example, running the preset translation plug-in to translate the text to be translated in the target medical device to obtain the target language text includes: running the preset translation plug-in to read the text to be translated in the translation plug-in according to a preset script module; obtaining a trained preset language translation model and inputting the text to be translated into the preset language translation model to obtain the target language text corresponding to the text to be translated.

[0010] It can be seen that in this embodiment, through the preset translation plug-in and its preset translation model, the source language text in the target medical device can be efficiently and accurately converted into the target language text and displayed in the display interface of the device, which not only improves the usability and user experience of the medical device, but also ensures the automation and efficiency of the translation process.

[0011] In a possible example, obtaining a trained preset language translation model includes: obtaining a medical database corresponding to the target medical device; using the corpus in the medical database as a first data set of an initial language translation model; performing data division on the first data set to obtain a first training data set and a verification data set; performing data preprocessing on the first training data set to obtain a target training data set that conforms to a format corresponding to the initial language translation model; training the initial language translation model according to the target training data set until a preset stop condition is met, stopping the training, and obtaining the preset language translation model.

[0012] It can be seen that in this embodiment, by training the model with data in the medical database, a language translation model optimized specifically for the medical field can be obtained, which can more accurately translate professional texts in medical equipment.

[0013] In a possible example, the data preprocessing of the first training data set to obtain a target training data set that conforms to a format corresponding to the initial language translation model includes: acquiring training text in the first training data set; performing word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text; mapping the word segmentation sequence corresponding to the training text to a pre-training model vocabulary to obtain an ID of each character in the word segmentation sequence corresponding to the training text; and formatting the word segmentation sequence corresponding to the training text and the ID of each character in the word segmentation sequence corresponding to the training text to obtain a target training data set that conforms to a format corresponding to the initial language translation model.

[0014] It can be seen that in this embodiment, by performing data preprocessing on the first training data set, it can be ensured that the preprocessed target training data set is suitable for the input requirements of the initial language translation model, thereby improving the effect of model training and translation quality.

[0015] In a possible example, the word segmentation processing of the training text to obtain the word segmentation sequence corresponding to the training text includes: obtaining the language type of the training text; determining a preset language structure according to the language type; and word segmentation processing of the training text according to the preset language structure to obtain the word segmentation sequence corresponding to the training text.

[0016] It can be seen that in this embodiment, the applicable preset language structure is determined according to the language type of the training text to ensure that the training text is correctly segmented, thereby providing high-quality data for training the translation model. Correct segmentation can improve the performance of the translation model, and word segmentation directly affects the model's understanding of the language structure and the accuracy of translation.

[0017] In a possible example, the preset stopping condition is that the training reaches a preset number of iterations or reaches a preset loss value.

[0018] It can be seen that in this embodiment, by setting the preset stop condition, the model training process can be effectively controlled to ensure that the model stops training after reaching a certain performance standard, or stops training in time when the training time is too long, thereby improving training efficiency and model performance.

[0019] In a possible example, after the initial language translation model is trained according to the target training data set until a preset stop condition is met, the training is stopped, and the preset language translation model is obtained, the method further includes: obtaining a verification text in the verification data set, wherein the verification text is an unsegmented text; inputting the verification text into the preset language translation model to obtain a target verification language text output by the preset language translation model; performing a quality assessment on the target verification language text according to a reference translation text to obtain a translation accuracy corresponding to the target verification language text; if the translation accuracy is greater than or equal to a preset threshold, determining that the preset language translation model is qualified; or, if the translation accuracy is less than the preset threshold, determining that the preset language translation model is unqualified, and retraining the preset language translation model.

[0020] It can be seen that in this embodiment, by performing performance testing on the preset language translation model through the verification data set, it can be ensured that the preset language translation model achieves the expected translation accuracy during the training and evaluation process and meets the actual application requirements.

[0021] In a second aspect, an embodiment of the present invention provides a translation device based on a language translation model, the device comprising:

[0022] A loading unit, used to load a preset translation plug-in in the target medical device, wherein the preset translation plug-in is used for conversion between multiple languages;

[0023] A translation unit, used to run the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language;

[0024] A display unit is used to display the target language text in a display interface corresponding to the target medical device.

[0025] In a third aspect, an embodiment of the present invention provides a computer device, including:

[0026] at least one processor; and,

[0027] a memory communicatively connected to the at least one processor; wherein,

[0028] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0029] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect.

[0030] In the solution implemented by the translation method and device based on the language translation model, the method first loads a preset translation plug-in in the target medical device, and the preset translation plug-in is used for conversion of multiple languages. Secondly, the preset translation plug-in is run to translate the text to be translated in the target medical device to obtain the target language text. Finally, the target language text is displayed in the display interface corresponding to the target medical device. The method loads a preset translation plug-in in the target medical device, which can realize automatic conversion of multiple languages, greatly improve the translation efficiency, and reduce the time and cost of manual translation; further, by running the preset translation plug-in, the text to be translated in the target medical device can be quickly and accurately converted into the target language text, ensuring that the user can operate and understand in his native language or familiar language, and improving the user experience; further, the preset translation plug-in supports the conversion of multiple languages, so that the target medical device can adapt to the market needs of different countries and regions, and expand the market coverage of the device. Finally, the target language text is displayed in the display interface corresponding to the target medical device, and the user can view the translation results in real time, ensuring the timeliness and accuracy of information transmission, which is conducive to the smooth progress of medical operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0032] Figure 1 It is a flowchart of a translation method based on a language translation model in one embodiment of the present invention;

[0033] Figure 2 is a structural schematic diagram of a translation device based on a language translation model in one embodiment of the present invention;

[0034] Figure 3 It is a schematic diagram of the structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0036] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0037] The technical solution of this application can be applied to various translation scenarios.

[0038] In view of this, the present application proposes a translation method based on a language translation model to solve the above problems, which is described in detail below.

[0039] See also Figure 1 , Figure 1 A flow chart of a translation method based on a language translation model provided in an embodiment of the present invention, the method comprising the following steps:

[0040] S10. Loading a preset translation plug-in in the target medical device, wherein the preset translation plug-in is used for conversion between multiple languages.

[0041] The target medical device may be a medical device of different types and have a user interface that needs to display text in multiple languages ​​for users with different language backgrounds, which is not a sole limitation. The target medical device may be a medical device that implements electrical impedance tomography technology, which is a non-invasive technology that reconstructs images of tissues in the body with the resistivity distribution inside the human body as the target. A chest electrical impedance tomography device is a medical device that uses this technology to provide patients with images of the lungs and blood flow inside the chest cavity.

[0042] Among them, the preset translation plug-in can be a module or component in the software system of the medical device, which is directly loaded into the target medical device for use. The preset translation plug-in includes conversion functions for multiple languages ​​and can recognize and process texts in different languages. The preset translation plug-in is loaded into the memory when the target medical device is started or running, so as to provide translation services at any time. For example, the preset translation plug-in can be a plug-in developed based on the Qt framework, which provides real-time multilingual translation functions for the application. The plug-in can load a preset translation model, translate the text to be translated, and integrate the translated text into the user interface of the application.

[0043] Among them, the preset translation plug-in not only supports translation between two languages, but can also handle translation of multiple language pairs, allowing medical devices to be used in multiple countries and regions around the world.

[0044] Among them, the preset translation plug-in may also include the following features: automatic detection of the language of the input text: providing more accurate translation based on the context of the target medical device; being able to translate text instantly when the user operates the device; storing translated text pairs to speed up subsequent translations and improve consistency, etc.

[0045] It can be seen that in this embodiment, loading a preset translation plug-in in the target medical device can realize automatic conversion of multiple languages, improve the international adaptability of the device, enhance the user experience, and also reduce the workload of engineers and improve the accuracy and convenience of translation.

[0046] S20: Run the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language.

[0047] Among them, in the target medical device, once the preset translation plug-in is loaded, it will be activated and run. Running the plug-in means activating its function and preparing to receive and process text data.

[0048] The texts to be translated may include menus, button labels, operating instructions, warning messages, diagnostic reports, etc. on the interface of the target medical device. The texts to be translated refer to the content that needs to be converted from the source language to the target language.

[0049] The text processed by the translation plug-in is the target language text. The target language text has been converted from the original source language to the language required by the user, ensuring that the user can understand and use the device. The target language text will be accurately displayed on the device interface, replacing the original source language text.

[0050] Specifically, the specific steps of running the preset translation plug-in may include: identifying and extracting the text to be translated from the user interface of the target medical device or other data sources; the preset translation plug-in analyzes the grammatical structure and contextual meaning of the text to ensure the accuracy of the translation; the preset translation plug-in uses a machine learning model, rule matching or other translation technology to convert the text; the translated text may require post-processing to correct grammatical errors, maintain terminology consistency, etc.

[0051] It can be seen that in this embodiment, the preset translation plug-in is used to translate the text to be translated in the target medical device to obtain the target language text, which not only improves the convenience of use of the device and the user experience, but also reduces the workload of engineers, ensures the professionalism and accuracy of the translation, and contributes to the promotion and application of the device in the international market.

[0052] S30. Displaying the target language text in a display interface corresponding to the target medical device.

[0053] The target medical device is usually equipped with a display interface for interaction with the user. This display interface may be a touch screen, LCD screen or other type of display device of the device. The display interface will display the device's operation menu, buttons, prompt information, diagnostic reports and other contents.

[0054] Specifically, the target medical device correctly maps the translated text content to various parts of the display interface. For example, the translated menu items, button labels, operation guides and other contents are displayed in the corresponding positions, so that users can intuitively see and understand this information.

[0055] Optionally, before displaying the target language text, the medical device's software needs to ensure that the user interface can adapt to text in different languages. This may include adjusting the size of the text box, changing the layout to accommodate longer or shorter text, handling languages ​​that read from right to left, etc.; the process of displaying text involves graphic rendering, including selecting the appropriate font, size, color, and style to ensure that the text is clear and readable on the display interface; in addition to language translation, displaying the target language text also needs to consider localization factors, such as using appropriate date formats, currency symbols, units of measurement, etc.

[0056] Among them, if an error occurs during the translation process or the target language text cannot be displayed correctly, the medical device needs to provide a feedback mechanism, such as displaying an error message or using the default language text as an alternative.

[0057] It can be seen that in this embodiment, by displaying the target language text in the display interface of the device, the usability and user experience of the medical device are improved, especially in a medical environment, which can effectively reduce misoperations and misunderstandings caused by language barriers.

[0058] The method loads a preset translation plug-in in the target medical device, which can realize automatic conversion of multiple languages, greatly improves translation efficiency, and reduces the time and cost of manual translation; further, by running the preset translation plug-in, the text to be translated in the target medical device is translated, and the text can be quickly and accurately converted into the target language text, ensuring that the user can operate and understand in his or her native language or a language familiar to him or her, thereby improving the user experience; further, the preset translation plug-in supports conversion of multiple languages, so that the target medical device can adapt to the market needs of different countries and regions, and expand the market coverage of the device; finally, the target language text is displayed in the display interface corresponding to the target medical device, and the user can view the translation result in real time, ensuring the timeliness and accuracy of information transmission, and facilitating the smooth progress of medical operations.

[0059] In one embodiment, the running of the preset translation plug-in to translate the text to be translated in the target medical device to obtain the target language text includes: running the preset translation plug-in to read the text to be translated in the translation plug-in according to a preset script module; obtaining a trained preset language translation model; inputting the text to be translated into the preset language translation model to obtain the target language text corresponding to the text to be translated.

[0060] The preset script module may be an xml module in a Python script, and the script module is used to parse the text to be translated in the translation plug-in.

[0061] The text to be translated can be the source language text in the ts file. ts is a file format for storing translation strings. The ts file is in XML format and contains multiple nodes. Each node contains the source language text and the translated target language text. By parsing the ts file, the XML node content of each translation text block can be read.

[0062] During the parsing process, the location tag (indicating the code file identification location where the text to be translated is located), the source tag (representing the text to be translated) and the translation tag (representing the translated target language text) are read.

[0063] Furthermore, the preset translation plug-in will call a preset language translation model that has been trained. The preset language translation model has been trained with a large amount of data and can efficiently and accurately convert the text to be translated into the target language text.

[0064] Among them, the preset language translation model can be obtained by training based on the large language model, and the type of the model is not limited here. For example, the Helsinki-NLP / opus-mt-zh-en translation model can be used to achieve the Chinese-to-English translation task, that is, the Helsinki-NLP / opus-mt-zh-en translation task model is used as the basis for model training to obtain the preset language translation model. Since the HuggingFace open source translation task model is highly generalized and has a low accuracy rate for specific vertical fields, it is necessary to add corpus in the medical device field to fine-tune its training in order to achieve better performance in this field.

[0065] Optionally, after the target language text corresponding to the text to be translated, the target language text is placed in a label of a node, or a new node is created to store the target language text.

[0066] This needs to be repeated for all nodes in the ts file to achieve batch translation of all texts to be translated. After the translation is completed, the updated xml content can be written back to the ts file, or the translated text can be directly displayed in the user interface of the medical device.

[0067] It can be seen that in this embodiment, through the preset translation plug-in and its preset translation model, the source language text in the target medical device can be efficiently and accurately converted into the target language text and displayed in the display interface of the device, which not only improves the usability and user experience of the medical device, but also ensures the automation and efficiency of the translation process.

[0068] In one embodiment, the method of obtaining a trained preset language translation model includes: obtaining a medical database corresponding to the target medical device; using the corpus in the medical database as a first data set of an initial language translation model; performing data division on the first data set to obtain a first training data set and a verification data set; performing data preprocessing on the first training data set to obtain a target training data set that conforms to a format corresponding to the initial language translation model; training the initial language translation model according to the target training data set until a preset stop condition is met, stopping the training, and obtaining the preset language translation model.

[0069] Among them, medical databases contain a large amount of text data such as medical terms, medical records, diagnostic reports, etc. And the data in medical databases are usually stored in structured or semi-structured forms, which may include XML, JSON, CSV and other formats.

[0070] The corpus includes the source language text (i.e. the text to be translated) and the corresponding target language text, forming a bilingual data set.

[0071] Optionally, the corpus in the medical database is cleaned to obtain cleaned corpus, and the cleaning is used to remove noise data and incomplete data to ensure the quality and consistency of the data.

[0072] The data division can be done by random sampling to ensure the representativeness of the training set and the validation set. The data division ratio is not limited here. For example, 70% of the data can be used as the training set and 30% of the data can be used as the validation set; or 80% of the data can be used as the training set and 20% of the data can be used as the validation set.

[0073] Among them, the training dataset is the dataset used to train the initial language translation model; the verification dataset is the dataset used to verify and evaluate the model performance.

[0074] Data preprocessing may include the following processes: text cleaning, which is used to remove irrelevant characters, correct errors, unify terminology, etc.; word segmentation, which is to divide the text into words or vocabulary units for model processing; encoding, which is used to convert the text into a digital code that the model can understand; serialization, which is used to convert the text into a sequence format suitable for a sequence-to-sequence (seq2seq) model.

[0075] The initial language translation model may be a neural network-based sequence-to-sequence model (Seq2Seq), a Transformer model, etc., and is not limited here.

[0076] Specifically, the preprocessed target training data set is input into the initial language translation model; through multiple rounds of iterative training, the model continuously adjusts parameters to optimize the translation performance. During the training process, a loss function (such as cross entropy loss) is used to evaluate the translation error of the model, and the parameters are updated through the back propagation algorithm; after each training cycle, the model is evaluated using a validation data set to monitor the performance of the model (such as BLEU score, accuracy, etc.).

[0077] Among them, the preset stopping conditions are set according to actual needs, for example: reaching the preset maximum number of training rounds; the training loss value drops below the preset threshold; the performance indicator on the verification data set (such as BLEU score) reaches the preset standard; when any of the preset stopping conditions is met, stop model training.

[0078] It can be seen that in this embodiment, by training the model with data in the medical database, a language translation model optimized specifically for the medical field can be obtained, which can more accurately translate professional texts in medical equipment.

[0079] In one embodiment, the data preprocessing of the first training data set to obtain a target training data set that conforms to the format corresponding to the initial language translation model includes: obtaining training text in the first training data set; performing word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text; mapping the word segmentation sequence corresponding to the training text to a pre-training model vocabulary to obtain an ID of each character in the word segmentation sequence corresponding to the training text; and formatting the word segmentation sequence corresponding to the training text and the ID of each character in the word segmentation sequence corresponding to the training text to obtain a target training data set that conforms to the format corresponding to the initial language translation model.

[0080] The training text contains the comparison data of the source language and the target language.

[0081] The word segmentation process is performed by selecting a suitable word segmentation tool, such as NLTK, SpaCy, Moses and other tools, which are not limited here.

[0082] Specifically, in the process of word segmentation, each training text is segmented into independent words or phrases to form a word segmentation sequence, where each element in the sequence is a word or character. For example, the sentence "This is a medical report" is segmented into ["This", "is", "a", "medical", "report"].

[0083] The pre-trained model vocabulary is the vocabulary built by the model during the pre-training phase, which usually contains a large number of common words or characters and their corresponding IDs. Uncommon words or characters may be mapped to a special unknown word (UNK) ID.

[0084] Specifically, the mapping process can be to map each word in the word segmentation sequence to the pre-trained model vocabulary to obtain the ID corresponding to each word. For example, in the vocabulary, the ID corresponding to "This" is 1, the ID corresponding to "is" is 2, and the ID corresponding to "medical" is 3. Then the word segmentation sequence ["This", "is", "a", "medical", "report"] is mapped to [1, 2, 4, 3, 5], where 4 and 5 are the IDs of "a" and "report".

[0085] The format processing is to convert the word segmentation sequence and its corresponding ID into the specific format required for model training, such as padding to the same length, or converting it into a tensor format that the model can understand.

[0086] Specifically, in the process of formatting the word sequence corresponding to the training text and the ID of each character in the word sequence corresponding to the training text, padding and truncation are performed on the word sequence to make all sequences of the same length. This process usually uses special markers (such as <pad>) for padding. For example, if the model requires the input sequence length to be 10, the sequence [1,2,4,3,5] needs to be padded to [1,2,4,3,5, <pad> , <pad> , <pad> , <pad> , <pad>]; add special markers at the beginning and end of the word sequence (such as <start>and <end>) to indicate the start and end of a sequence. For example, the processed sequence may be [ <start> ,1,2,4,3,5, <end> , <pad> , <pad> , <pad>]; Create a mask matrix to indicate the filling position. The 1 in the mask matrix represents the actual data and the 0 represents the filling data; convert the word segmentation sequence and its corresponding ID into the data format required by the model, such as the tensor format, so as to be input into the neural network for training.

[0087] Therefore, after the above processing steps, the target training dataset obtained contains the word segmentation sequences of the training text and their corresponding IDs, and has been padded, truncated, marked and format converted to meet the input requirements of the initial language translation model.

[0088] It can be seen that in this embodiment, by performing data preprocessing on the first training data set, it can be ensured that the preprocessed target training data set is suitable for the input requirements of the initial language translation model, thereby improving the effect of model training and translation quality.

[0089] In one embodiment, the word segmentation processing of the training text to obtain the word segmentation sequence corresponding to the training text includes: obtaining the language type of the training text; determining a preset language structure according to the language type; and performing word segmentation processing on the training text according to the preset language structure to obtain the word segmentation sequence corresponding to the training text.

[0090] Among them, each training text in the first training data set may contain a language identifier (such as a language code), for example, "en" represents English, "zh" represents Chinese, etc.; but the training text in the first training data set does not have a clear language identifier, so the identification of the language type can be determined by a language detection tool or information in the metadata.

[0091] The preset language structure refers to the word segmentation rules and grammar models designed for a specific language. For example, English usually uses words as the basic unit, while Chinese needs to be segmented based on the combination of Chinese characters.

[0092] Different languages ​​have different language structures and word segmentation rules. For example, English is a language based on space segmentation, while Chinese is a language based on character segmentation.

[0093] Specifically, the applicable preset language structure is determined according to the language type of the training text. For example, English is segmented based on spaces and punctuation marks; Chinese is segmented based on characters or words, and Chinese segmentation tools (such as Jieba, THULAC, etc.) are usually used; other languages ​​select appropriate segmentation methods and tools based on the characteristics of the specific language.

[0094] Among them, in the process of word segmentation processing of the training text according to the preset language structure, first select a word segmentation tool suitable for the language type, for example: English uses NLTK, SpaCy and other tools for word segmentation, and Chinese uses Jieba, THULAC and other tools for word segmentation; further load the corresponding word segmentation tool and dictionary; then according to the preset language structure, apply the word segmentation algorithm to perform word segmentation processing on the training text. For example, for English, use spaces and punctuation marks for word segmentation; for Chinese, use dictionaries and statistical methods for word segmentation; finally, obtain the word segmentation sequence corresponding to the training text. For example, for the sentence "This is a medical report", the word segmentation result is ["This", "is", "a", "medical", "report"]; for the Chinese sentence "This is a medical report", the word segmentation result is ["this", "is", "a", "medical", "report"].

[0095] It can be seen that in this embodiment, the applicable preset language structure is determined according to the language type of the training text to ensure that the training text is correctly segmented, thereby providing high-quality data for training the translation model. Correct segmentation can improve the performance of the translation model, and word segmentation directly affects the model's understanding of the language structure and the accuracy of translation.

[0096] In one embodiment, the preset stopping condition is that the training reaches a preset number of iterations or reaches a preset loss value.

[0097] Epochs refers to the number of times the entire training data set is completely passed through the model. The preset number of iterations refers to a fixed number of iterations set before the training starts. When the training reaches this number, the training stops.

[0098] Specifically, the preset number of iterations can be selected according to past experience or experimental results. For example, for some tasks, 100 iterations may be required, while for other tasks, more or fewer iterations may be required; or the preset number of iterations can be determined by monitoring the performance of the model on the validation set (such as accuracy, loss value, etc.) during the training process, and adjusting the number of iterations according to performance changes.

[0099] Among them, the loss value is an indicator to measure the difference between the model prediction result and the true value. The preset loss value refers to a target loss value set before the training starts. When the loss value of the model during the training process reaches or falls below this target value, the training is stopped.

[0100] Specifically, the preset loss value can set a reasonable loss value according to the specific requirements of the task and the performance goals of the model. For example, for classification tasks, a lower cross entropy loss value can be set; for regression tasks, a lower mean square error can be set; or during the training process, the preset loss value can dynamically adjust the target loss value according to the performance of the model on the validation set to ensure that the model stops training when the preset loss value is reached.

[0101] Optionally, the preset stop condition may be a dynamic stop condition, for example, if the loss value does not decrease significantly after several consecutive iterations, the training of the model is stopped.

[0102] It can be seen that in this embodiment, by setting the preset stop condition, the model training process can be effectively controlled to ensure that the model stops training after reaching a certain performance standard, or stops training in time when the training time is too long, thereby improving training efficiency and model performance.

[0103] In one embodiment, after the initial language translation model is trained according to the target training data set until a preset stop condition is met, the training is stopped, and the preset language translation model is obtained, the method further includes: obtaining a verification text in the verification data set, wherein the verification text is an unsegmented text; inputting the verification text into the preset language translation model to obtain a target verification language text output by the preset language translation model; performing a quality assessment on the target verification language text according to a reference translation text to obtain a translation accuracy corresponding to the target verification language text; if the translation accuracy is greater than or equal to a preset threshold, determining that the preset language translation model is qualified; or, if the translation accuracy is less than the preset threshold, determining that the preset language translation model is unqualified, and retraining the preset language translation model.

[0104] The verification text is the unsegmented text, that is, the original text that has not been segmented.

[0105] Specifically, necessary preprocessing is performed on the verification text (such as removing special characters, normalization, etc.) to make it meet the model input requirements; the preprocessed verification text is input into the preset language translation model, and the model will translate these texts to generate the target verification language text.

[0106] Among them, the reference translation text is the corresponding standard translation text in the verification dataset, which is usually provided by professional translators as a benchmark for evaluating the translation quality of the model.

[0107] Among them, quality assessment can be performed on the target verification language text using automated evaluation indicators (such as BLEU, ROUGE, METEOR, etc.) or manual evaluation methods to calculate its translation accuracy. For example, BLEU (Bilingual Evaluation Understudy) score is a commonly used machine translation evaluation indicator, which evaluates the translation quality by comparing the similarity between the target verification language text and the reference translation text.

[0108] Among them, translation accuracy is a quantitative indicator used to measure the accuracy of model translation, which is usually determined by calculating the similarity between the target verification language text and the reference translation text. Common evaluation indicators include BLEU (Bilingual Evaluation Understudy), METEOR, ROUGE, etc.

[0109] Among them, translation accuracy can be expressed by a specific value, usually between 0 and 1. The higher the value, the better the translation quality.

[0110] The preset threshold is a pre-set accuracy standard used to determine whether the translation quality of the model reaches an acceptable level. For example, the preset threshold may be 0.7 or 0.8, which is not a unique limitation.

[0111] Specifically, if the translation accuracy reaches or exceeds a preset threshold, the model is considered qualified; if it is lower than the threshold, the model is considered unqualified and needs to be retrained.

[0112] Among them, unqualified models need to be retrained and optimized. Improvements can be made in the following ways: increase the amount and diversity of training data to improve the generalization ability of the model; adjust the model architecture and hyperparameters (such as learning rate, batch size, etc.) to improve model performance; improve data preprocessing and feature extraction methods to enhance the input quality of the model; adopt more advanced training strategies, such as transfer learning, data enhancement, regularization, etc., to improve the robustness of the model.

[0113] It can be seen that in this embodiment, by performing performance testing on the preset language translation model through the verification data set, it can be ensured that the preset language translation model achieves the expected translation accuracy during the training and evaluation process and meets the actual application requirements.

[0114] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0115] As another aspect of the embodiment of the present application, the embodiment of the present application provides a translation device based on a language translation model. The translation device based on the language translation model can be a software module, and the software module includes a number of instructions stored in a memory, and the processor can access the memory and call the instructions for execution to complete the translation method based on the language translation model described in the above various embodiments.

[0116] See also Figure 2 , Figure 2 It is a structural diagram of a translation device based on a language translation model provided in an embodiment of the present application.

[0117] like Figure 2 As shown, the translation device 200 based on the language translation model includes:

[0118] A loading unit 201 is used to load a preset translation plug-in in the target medical device, wherein the preset translation plug-in is used for conversion between multiple languages;

[0119] A translation unit 202, configured to run the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language;

[0120] The display unit 203 is used to display the target language text in a display interface corresponding to the target medical device.

[0121] The method loads a preset translation plug-in in the target medical device, which can realize automatic conversion of multiple languages, greatly improves translation efficiency, and reduces the time and cost of manual translation; further, by running the preset translation plug-in, the text to be translated in the target medical device is translated, and the text can be quickly and accurately converted into the target language text, ensuring that the user can operate and understand in his or her native language or a language familiar to him or her, thereby improving the user experience; further, the preset translation plug-in supports conversion of multiple languages, so that the target medical device can adapt to the market needs of different countries and regions, and expand the market coverage of the device; finally, the target language text is displayed in the display interface corresponding to the target medical device, and the user can view the translation result in real time, ensuring the timeliness and accuracy of information transmission, and facilitating the smooth progress of medical operations.

[0122] In one embodiment, when running the preset translation plug-in, translating the text to be translated in the target medical device to obtain the target language text, the translation unit 202 is further used to: run the preset translation plug-in, read the text to be translated in the translation plug-in according to a preset script module; obtain a trained preset language translation model; input the text to be translated into the preset language translation model to obtain the target language text corresponding to the text to be translated.

[0123] In one embodiment, in the acquisition of the trained preset language translation model, the translation unit 202 is further used to: acquire a medical database corresponding to the target medical device; use the corpus in the medical database as a first data set of the initial language translation model; perform data division on the first data set to obtain a first training data set and a verification data set; perform data preprocessing on the first training data set to obtain a target training data set that conforms to the format corresponding to the initial language translation model; train the initial language translation model according to the target training data set until a preset stop condition is met, stop the training, and obtain the preset language translation model.

[0124] In one embodiment, in the data preprocessing of the first training data set to obtain a target training data set that conforms to the format corresponding to the initial language translation model, the translation unit 202 is further used to: obtain training text in the first training data set; perform word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text; map the word segmentation sequence corresponding to the training text to a pre-training model vocabulary to obtain an ID of each character in the word segmentation sequence corresponding to the training text; perform format processing on the word segmentation sequence corresponding to the training text and the ID of each character in the word segmentation sequence corresponding to the training text to obtain a target training data set that conforms to the format corresponding to the initial language translation model.

[0125] In one embodiment, in the process of performing word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text, the translation unit 202 is further used to: obtain a language type of the training text; determine a preset language structure according to the language type; and perform word segmentation processing on the training text according to the preset language structure to obtain a word segmentation sequence corresponding to the training text.

[0126] In one embodiment, the preset stopping condition is that the training reaches a preset number of iterations or reaches a preset loss value.

[0127] In one embodiment, after the initial language translation model is trained according to the target training data set until a preset stop condition is met, the training is stopped, and the preset language translation model is obtained, the translation unit 202 is further used to: obtain a verification text in the verification data set, wherein the verification text is an unsegmented text; input the verification text into the preset language translation model to obtain a target verification language text output by the preset language translation model; perform a quality assessment on the target verification language text according to a reference translation text to obtain a translation accuracy corresponding to the target verification language text; if the translation accuracy is greater than or equal to a preset threshold, determine that the preset language translation model is qualified; or, if the translation accuracy is less than the preset threshold, determine that the preset language translation model is unqualified, and retrain the preset language translation model.

[0128] It should be noted that the above-mentioned translation device based on the language translation model can execute the translation method based on the language translation model provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the translation device based on the language translation model, please refer to the translation method based on the language translation model provided in the embodiment of the present application.

[0129] See also Figure 3 , Figure 3 3 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device includes one or more processors 31 and a memory 32. The memory 32 is connected to the one or more processors 31, for example, connected to the processor 31 via a bus.

[0130] The processor 31 is configured to support the computer device to perform the corresponding functions in the method in the above method embodiment. The processor 31 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0131] The memory 32 is used to store program codes, etc. The memory 32 may include a volatile memory (VM), such as a random access memory (RAM); the memory 32 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 32 may also include a combination of the above-mentioned types of memories.

[0132] The memory 32 can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the translation method based on the language translation model in the embodiment of the present application. The processor 31 executes various functional applications and data processing of the translation method based on the language translation model and the translation device based on the language translation model by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, realizes the functions of the translation method based on the language translation model and the translation device based on the language translation model provided in the above method embodiment.

[0133] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created based on the use of a translation device based on a language translation model, etc. In some embodiments, the memory 32 may optionally include a memory 32 remotely arranged relative to the processor 31, and these remote memories 32 may be connected to the translation device based on the language translation model via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0134] The one or more modules are stored in the memory 32. When executed by the one or more processors 31, the translation method based on the language translation model in any of the above method embodiments is executed, for example, the method steps described in the above method embodiments are executed to realize the functions of the modules described in the above device embodiments.

[0135] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.

[0136] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0137] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.< / pad> < / pad> < / pad> < / end> < / start> < / end> < / start> < / pad> < / pad> < / pad> < / pad> < / pad> < / pad>

Claims

1. A translation method based on a language translation model, characterized in that: Applications in target medical devices include: In the target medical device, a preset translation plug-in is loaded, wherein the preset translation plug-in is used for conversion between multiple languages; Running the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language; The target language text is displayed in a display interface corresponding to the target medical device.

2. The method according to claim 1, characterized in that The running of the preset translation plug-in to translate the text to be translated in the target medical device to obtain the target language text includes: Running the preset translation plug-in, and reading the text to be translated in the translation plug-in according to the preset script module; Get the trained preset language translation model; The text to be translated is input into the preset language translation model to obtain a target language text corresponding to the text to be translated.

3. The method according to claim 2, characterized in that The step of obtaining the trained preset language translation model includes: Acquire a medical database corresponding to the target medical device; Using the corpus in the medical database as the first data set of the initial language translation model; Dividing the first data set into a first training data set and a validation data set; Performing data preprocessing on the first training data set to obtain a target training data set that conforms to a format corresponding to the initial language translation model; The initial language translation model is trained according to the target training data set until a preset stopping condition is met, and the training is stopped to obtain the preset language translation model.

4. The method according to claim 3, characterized in that The step of preprocessing the first training data set to obtain a target training data set that conforms to a format corresponding to the initial language translation model includes: Obtaining training text in the first training data set; Performing word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text; Mapping the word segmentation sequence corresponding to the training text into the pre-training model vocabulary to obtain the ID of each character in the word segmentation sequence corresponding to the training text; The word segmentation sequence corresponding to the training text and the ID of each character in the word segmentation sequence corresponding to the training text are formatted to obtain a target training data set that conforms to the format corresponding to the initial language translation model.

5. The method according to claim 4, characterized in that The performing word segmentation processing on the training text to obtain a word segmentation sequence corresponding to the training text includes: Acquire the language type of the training text; Determining a preset language structure according to the language type; The training text is segmented according to the preset language structure to obtain a segmentation sequence corresponding to the training text.

6. The method according to claim 3, characterized in that The preset stopping condition is that the training reaches a preset number of iterations or reaches a preset loss value.

7. The method according to claim 3, characterized in that After training the initial language translation model according to the target training data set until a preset stop condition is met and the training is stopped to obtain the preset language translation model, the method further includes: Obtaining a verification text in the verification data set, wherein the verification text is an unsegmented text; Inputting the verification text into the preset language translation model to obtain a target verification language text output by the preset language translation model; Performing a quality assessment on the target verification language text according to the reference translation text to obtain the translation accuracy corresponding to the target verification language text; If the translation accuracy is greater than or equal to a preset threshold, the preset language translation model is determined to be qualified; or, If the translation accuracy is less than the preset threshold, the preset language translation model is determined to be unqualified, and the preset language translation model is retrained.

8. A translation device based on a language translation model, applied to a target medical device, the device comprising: A loading unit, used to load a preset translation plug-in in the target medical device, wherein the preset translation plug-in is used for conversion between multiple languages; A translation unit, used to run the preset translation plug-in to translate the text to be translated in the target medical device to obtain the text in the target language; A display unit is used to display the target language text in a display interface corresponding to the target medical device.

9. A computer device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the computer device implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Systems and methods for digitally interpreting a linguistic section of a source file via highlighting on a graphical user interface

    US12591733B1