Text translation method, server, storage medium, and program product
By introducing external knowledge from the translation database into the text translation model, the problem of inaccurate translation of customized vocabulary by the end-to-end model is solved, and efficient and accurate translation of proper nouns and new words is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2025-09-24
- Publication Date
- 2026-05-21
AI Technical Summary
Existing end-to-end text translation models are prone to knowledge illusions when dealing with domain-specific nouns, new words, and rare words, resulting in low accuracy of translation results.
By searching translation databases for translated text pairs that match the original text and inputting them into a text translation model, external knowledge intervention can be applied to improve the translation accuracy of customized vocabulary and avoid retraining the model parameters.
Without changing the model parameters, the accuracy of translation of proper nouns, technical terms and new words was significantly improved, thus enhancing the accuracy and efficiency of text translation results.
Smart Images

Figure CN2025123549_21052026_PF_FP_ABST
Abstract
Description
Text translation methods, servers, storage media, and application products
[0001] This application claims priority to Chinese Patent Application No. 202411614367.2, filed on November 12, 2024, entitled “Text Translation Method, Server, Storage Medium and Program Product”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to computer technology, and more particularly to a text translation method, server, storage medium, and program product. Background Technology
[0003] With the continuous development of artificial intelligence technology, text translation models are being applied more and more widely. Text translation models can convert text in one language (called the source language) into translated text in another language (called the target language).
[0004] Currently, end-to-end text translation models are insufficient in learning domain-specific nouns, new words, and rare words, which can easily lead to knowledge illusions and result in low accuracy of text translation results. Summary of the Invention
[0005] This application provides a text translation method, server, storage medium, and program product to solve the problem of low accuracy in the translation results of text translation models.
[0006] Firstly, this application provides a text translation method, including:
[0007] Obtain the original text to be translated and the target language to be translated into;
[0008] Search a translation database for translation text pairs that match the original text. The translation database includes translation text pairs containing at least one custom term, and the translation text pairs include source language text and target language text.
[0009] The original text, the target language, and the translated text are input into a text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
[0010] Secondly, this application provides a text translation method, including:
[0011] The receiving end device sends a translation request, which includes the original text to be translated and the target language to be translated into;
[0012] Search a translation database for a translation text pair that matches the original text. The translation database includes at least one translation text pair for a custom word, and the translation text pair includes the source language text and the target language text of the custom word.
[0013] The original text and the translated text are input into the text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
[0014] The translated text in the target language is returned to the terminal device.
[0015] Thirdly, this disclosure provides a server, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the server to perform the methods provided in any of the foregoing aspects.
[0016] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method provided in any of the foregoing aspects.
[0017] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the methods provided in any of the foregoing aspects.
[0018] The text translation method, server, storage medium, and program products disclosed herein acquire the original text to be translated and the target language to be translated; search a translation database for translation text pairs that match the original text, the translation database including at least one translation text pair with a custom term, the translation text pair including the source language text and the target language text; input the original text, the target language, and the translation text pair into a text translation model, the text translation model translating the source language text appearing in the original text into the corresponding target language text, and generating the translated text in the target language corresponding to the original text. By applying external knowledge intervention to the text translation model based on a pre-customized translation database, translation errors of custom terms can be effectively avoided without retraining the parameters of the text translation model, thereby improving the accuracy of the text translation model in translating custom terms such as proper nouns, technical terms, and neologisms, and thus improving the accuracy of the text translation results. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0020] Figure 1 is a schematic diagram of an example system architecture to which this disclosure applies;
[0021] Figure 2 is a flowchart of a text translation method provided in an exemplary embodiment of this disclosure;
[0022] Figure 3 is an example diagram of text translation provided by an exemplary embodiment of this disclosure;
[0023] Figure 4 is a flowchart illustrating the framework for fine-tuning training of a text translation model provided in an exemplary embodiment of this disclosure;
[0024] Figure 5 is a framework diagram for constructing training data provided by an exemplary embodiment of this disclosure;
[0025] Figure 6 is a flowchart of a method for constructing a translation database provided in an exemplary embodiment of this disclosure;
[0026] Figure 7 is a flowchart of a text translation method provided in another exemplary embodiment of this disclosure;
[0027] Figure 8 is a schematic diagram of the structure of a server provided in an embodiment of this disclosure.
[0028] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0030] It should be noted that the user information (including but not limited to user device information, user attribute information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0031] First, let's explain the terms used in this disclosure:
[0032] Translation Large Language Model: A large model focused on translation functions, trained based on the Large Language Model (LLM).
[0033] Supervised fine-tuning (SFT) is a technique for training large models to align with instructions and human preferences.
[0034] Retrieval Argument Generation (RAG) is a technique for large models to utilize external knowledge.
[0035] Token: Also known as a token or mark, it refers to the state of a word after natural language has been segmented by a large model.
[0036] Pre-trained language model: A pre-trained model obtained by pre-training a large language model (LLM).
[0037] Large models refer to deep learning models with a massive number of parameters, typically containing hundreds of millions, tens of billions, or even trillions of parameters. Large models can also be called foundational models or basic models. They are pre-trained using large-scale unlabeled corpora, producing pre-trained models with hundreds of millions of parameters. These models can adapt to a wide range of downstream tasks and have good generalization capabilities; examples include large language models and multimodal pre-trained models.
[0038] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as NLP tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0039] This disclosure provides a text translation method, which involves: acquiring the original text to be translated and the target language to be translated; searching a translation database for translation text pairs that match the original text, wherein the translation database includes translation text pairs of at least one custom vocabulary, and each translation text pair includes the source language text and the target language text of the custom vocabulary; inputting the original text and the translation text pair into a text translation model, and using the text translation model to translate the source language text appearing in the original text into the corresponding target language text, thereby generating the translated text in the target language.
[0040] The translation database includes at least one translation text pair for a customized term. Each translation text pair consists of the source language audio and the target language text for the customized term. The customized term can include proper nouns, technical terms, neologisms, rare words, and other words that the model is prone to translating incorrectly. It can be customized according to the specific needs of the application scenario.
[0041] A text translation model can be obtained by fine-tuning any pre-trained text translation model. The pre-trained text translation model used can be an end-to-end translation model or other models with similar functions. The specific model can be selected according to the actual application requirements, and no specific restrictions are made here.
[0042] Traditional text translation models, when learning specific proper nouns or new words, typically require supervised fine-tuning using a batch of corresponding data. This disclosure provides a large-scale text translation model with external knowledge intervention capabilities, which can adapt to customized vocabulary such as specific proper nouns and new words without retraining the model parameters. The method disclosed herein, based on a pre-customized translation database, intervenes with external knowledge in the text translation model, effectively avoiding translation errors of customized vocabulary without retraining the model parameters. This improves the accuracy of the text translation model in translating customized vocabulary such as proper nouns, technical terms, and new words, thereby enhancing the accuracy of the text translation results.
[0043] Figure 1 is a schematic diagram of an example system architecture to which this disclosure applies. As shown in Figure 1, the system architecture includes a server and end-side devices. The server and end-side devices have a communication link that enables communication between them.
[0044] In this context, a server is a computing device deployed in the cloud or locally, such as a cloud cluster. The server stores text translation models and translation databases.
[0045] Edge devices can be electronic devices that run downstream systems / applications. Specifically, they can be hardware devices with network communication, computing, and information display functions, including but not limited to smartphones, tablets, desktop computers, local servers, and cloud servers. During the process of running downstream systems / applications, edge devices need to translate original text in one language (called the source language) into translated text in another language (called the target language).
[0046] In one example scenario, the endpoint device is a terminal device running a text translation application. The endpoint device can receive the original text to be translated input by the user and obtain the target language specified by the user. The endpoint device then sends a translation request to the server to translate the original text into the target language. This translation request includes the original text and the target language to be translated.
[0047] The server receives a translation request from the client device and retrieves the original text to be translated and the target language to be translated from the request. Further, the server searches the translation database for translation text pairs that match the original text; each translation text pair includes both the source language text and the target language text. The server then inputs the original text and the matching translation text pairs into a text translation model. The model translates the source language text appearing in the original text into the corresponding target language text and generates the translated text in the target language. The server returns the translated text in the target language to the client device.
[0048] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0049] Figure 2 is a flowchart of a text translation method provided in an exemplary embodiment of this disclosure. The execution entity in this embodiment is the server in the aforementioned system architecture. As shown in Figure 2, the specific steps of the method are as follows:
[0050] Step S201: Obtain the original text to be translated and the target language to be translated.
[0051] This embodiment is used to translate original text in one language into translated text in another language. The language used in the original text to be translated is called the source language, which can be any language. The target language refers to the language used in the translated text, which can be any language other than the source language. For example, if the source language is Chinese and the target language is English, the original Chinese text is translated into English. Similarly, if the source language is English and the target language is Russian, the original English text is translated into Russian.
[0052] In this step, the server can receive the original text to be translated and the target language to be translated from the end device. The method by which the end device obtains the original text to be translated and the target language to be translated can be designed and adjusted according to the needs of the actual application system, and is not specifically limited here.
[0053] In one example scenario, the endpoint device is a terminal device running a text translation application. The endpoint device can receive raw text in the source language input by the user and obtain the target language specified by the user. The endpoint device sends a translation request to the server, which includes both the source text and the target language. The server receives the translation request from the endpoint device and retrieves the source text to be translated and the target language to be translated from the request.
[0054] Step S202: Search the translation database for translation text pairs that match the original text. The translation database includes translation text pairs of at least one customized term. Each translation text pair includes the source language text and the target language text of the customized term.
[0055] The translation database is pre-built and includes at least one translation text pair for a customized term. Each translation text pair for a customized term includes the source language text and the target language text for that customized term. Customized terms are personalized based on specific application scenarios and can include proper nouns, technical terms, neologisms, rare words, etc., from various fields. They can also include words that other translation models are prone to translating incorrectly; the specific customization can be tailored to the needs of the actual application scenario.
[0056] After obtaining the original text to be translated and the target language to be translated, the server searches the translation database for translation text pairs that match the original text to provide external translation references to the text translation model and to intervene externally in the translation process of the text translation model.
[0057] In this step, the server can match the original text with the source language text contained in the translation text pairs in the translation database, determine the translation text pairs in the original text that contain the source language text, and obtain the translation text pairs that match the original text.
[0058] Optionally, when matching the original text with the source language text contained in the translation text pair in the translation database, a character-level matching algorithm can be used, such as the KMP (Knuth-Morris-Pratt) algorithm, a hash-based string matching algorithm, or other string matching algorithms, to determine whether the source language text contained in the translation text pair appears in the original text. Alternatively, other matching algorithms can be used, but this embodiment does not impose specific limitations on them.
[0059] Step S203: Input the original text, target language, and translated text into the text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
[0060] The text translation model can be obtained by fine-tuning any pre-trained text translation model. The pre-trained text translation model used can be an end-to-end translation model or other models with similar functions. The specific model can be selected according to the actual application requirements, and no specific restrictions are made here.
[0061] In this step, the original text, the target language, and the translated text pair matching the original text are inserted into prompt words to generate task instructions. These task instructions guide the text translation model to generate the target language translation of the original text based on the translated text pair. The task instructions are then input into the text translation model. Based on these prompts, the model translates the original language text appearing in the original text into the corresponding target language text and generates the target language translation. By providing the text translation model with the translated text pair matching the original text as reference knowledge, external knowledge intervention is achieved in the end-to-end text translation model. This effectively avoids translation errors of customized vocabulary and improves the accuracy of the translation model for customized vocabulary such as proper nouns, technical terms, and neologisms, thereby enhancing the accuracy of the translation results.
[0062] For example, the server can obtain pre-configured prompts for text translation, which include: a task objective, a slot for inserting the original text to be translated, a slot for inserting the target language, and a slot for inserting the translated text pair. The task objective indicates the function of the prompt, that is, to prompt the model to convert the given original text into translated text in the specified target language. The original text slot is a placeholder in the prompt for inserting the original text to be translated. The target language slot is a placeholder for inserting the target language. The text pair slot is also a placeholder in the prompt for inserting the translated text pair that matches the original text. Additionally, the prompt may include system examples, constraint information, etc. The system examples can be pre-designed and given examples that provide reference examples for the model to achieve the task objective. The constraint information may include information that the model needs to pay attention to during the generation of execution results, such as the output format of the execution results and the requirements that need to be met.
[0063] For example, here is an example of prompt words used to implement text translation:
[0064] "You are an AI assistant that converts the following raw text into translated text in {target language}."
[0065] Original text: {org_text}\n
[0066] Note: This bilingual dictionary includes some words. If you find these words in a sentence, please translate them as follows: {Source Language Text}:{Target Language Text}; {Source Language Text}:{Target Language Text}; ……
[0067] The prompt example gives the task objective: "You are an AI assistant. Convert the following raw text into translated text in {target language}". "{target language}" is used to insert the target language to be translated. `{org_text}` represents the raw text slot used to insert the raw text. `{raw_language_text}:{target_language_text}` represents the text pair slot used to insert a translated text pair, where `{raw_language_text}` is used to insert the raw language text in the translated text pair, and `{target_language_text}` is used to insert the target language text in the translated text pair. It should be noted that if there are multiple translated text pairs matching the raw text, multiple translated text pairs can be inserted according to the format shown in the previous example (the insertion format for each translated text pair is the same).
[0068] Furthermore, the server inserts the original text, the target language, and the translated text pairs matching the original text into prompt words to generate task instructions. These task instructions guide the text translation model to generate the target language translation of the original text based on the translated text pairs. The server inputs the task instructions into the text translation model, which, based on the prompts, translates the original language text appearing in the original text into the corresponding target language text and generates the target language translation.
[0069] The solution in this embodiment intervenes with external knowledge on the text translation model based on a pre-customized translation database. This effectively avoids translation errors of customized words without retraining the parameters of the text translation model, and can improve the accuracy of the text translation model in translating customized words such as proper nouns, technical terms, and new words, thereby improving the accuracy of the text translation results.
[0070] The solution in this embodiment only requires a single search in the translation knowledge base after obtaining the original text to be translated and the target language to be translated, to obtain a translation text pair that matches the original text. This translation text pair includes the source language text and the target language text of the customized vocabulary appearing in the original text. Furthermore, the translation text pair that matches the original text is input into the text translation model along with the original text and the target language. This does not affect the inference speed of the translation model. Compared to intervention schemes that correct the output probability distribution of the translation model, this can accelerate the inference speed of the text translation model and improve the efficiency of text translation. Moreover, when no intervention is needed, the translation text pair that matches the original text is no longer obtained; the original text and the target language are simply input into the text translation model for inference. This allows for a plug-and-play effective improvement in the translation accuracy of the text translation model for proper nouns, technical terms, neologisms, etc.
[0071] For example, Figure 3 is an example diagram of text translation provided in this embodiment. As shown in Figure 3, taking the translation task of translating a given original English text into Chinese as an example, given the original English text "Hi, Dr. Ye. The meeting now supports 15 different languages, including Chinese, English, Japanese, and Korean. Today, we have specially invited several colleagues who speak different languages to participate in the demonstration.", the translation model is required to translate the original text into Chinese.
[0072] If a traditional translation model is used, the input to the traditional translation model is as follows:
[0073] Translate the following English text into Chinese:
[0074] The original English text:
[0075] Hi, Dr. Ye. The meeting now supports 15 different languages, including Chinese, English, Japanese, and Korean. Today, we have specially invited several colleagues who speak different languages to participate in the demonstration.
[0076] Chinese translation text: "
[0077] Traditional translation models would translate "Dr. Ye" as "Dr. Ye", and the generated translation text would be: "Hello everyone, Dr. Ye. The meeting now supports 15 different languages, including Chinese, English, Japanese, and Korean. Today, we have specially invited several colleagues who speak different languages to participate in the demonstration."
[0078] In actual application scenarios, "Dr. Ye" is a proper noun and should be translated as "Teacher Buqiong". Using the solution of the present disclosure, the following translation text pair is added to the translation database: English: "Dr. Ye", Chinese: "Teacher Buqiong", as external knowledge. When performing translation, the input to the text translation model is as follows:
[0079] "Translate the following English text into Chinese:
[0080] Original English text:
[0081] Hi, Dr. Ye. The meeting now supports 15 different languages, including Chinese, English, Japanese, and Korean. Today, we have specially invited several colleagues who speak different languages to participate in the demonstration.
[0082] Note: Some words are included in the bilingual dictionary. If you find these words in a sentence, please translate them as follows:[[ID=As this example demonstrates, the solution disclosed herein, by intervening externally in the translation process of a text translation model based on translated text pairs provided in a translation database, effectively avoids translation errors of customized vocabulary without retraining the parameters of the text translation model. This can improve the accuracy of the text translation model in translating customized vocabulary such as proper nouns, technical terms, and neologisms, thereby improving the accuracy of the text translation results.
[0087] Figure 4 is a flowchart illustrating the framework for fine-tuning training of a text translation model according to an exemplary embodiment of this disclosure. As shown in Figure 4, the framework for fine-tuning training of the text translation model is as follows:
[0088] Step S401: Obtain text translation data, which includes the original text and the target text in the target language corresponding to the original text.
[0089] In this embodiment, before fine-tuning the pre-trained text translation model, it is necessary to first construct training data with external translation knowledge intervention for the fine-tuning training.
[0090] To construct the training data used for fine-tuning, this step involves the server collecting a large amount of high-quality bilingual parallel text translation data, including corresponding translation texts in both languages, i.e., source text in the source language and corresponding target text in the target language. This bilingual parallel text translation data can be obtained from publicly available datasets used for text translation.
[0091] Step S402: Based on the text translation data, construct training data, which includes: the original text, the target text corresponding to the original text, the original language, the target language, and the translation text pairs containing customized vocabulary in the original text.
[0092] After acquiring a large amount of bilingual parallel text translation data, translation text pairs containing customized vocabulary from the original text are generated. Training data is then constructed, comprising the original text, target text, source language, target language, and translation text pairs containing customized vocabulary from the original text. The translation text pairs containing customized vocabulary include both the source language text and the target language text containing the customized vocabulary.
[0093] Optionally, when generating translation text pairs for the customized terms contained in the original text, a text pair extraction model is used to extract translation text pairs for the customized terms from the original text and the corresponding target text, thus obtaining translation text pairs for the customized terms contained in the original text. Specifically, the text pair extraction model is used to extract text pairs of entity names from the original text and the target text, including the original language text and the target language text of the entity names; the entity names are used as customized terms, and the extracted text pairs of entity names are used as translation text pairs for the customized terms. The translation text pairs for the customized terms include the original language text and the target language text of the customized terms. The text pair extraction model can be implemented using any large natural language processing model, such as LLM; this embodiment does not impose specific limitations here.
[0094] For example, when using a large model to extract text pairs of entity names from source and target text, the server can obtain pre-configured text pair extraction prompts. These prompts include: a task objective, a source text slot for inserting the source text, and a target text slot for inserting the target text. The task objective indicates the function of the text pair extraction prompts, that is, prompting the large model to extract source and target language texts of the same entity name from the source and target texts to form text pairs of entity names. The source text slot is a placeholder for inserting the source text to be translated. The target text slot is also a placeholder for inserting the target text. Additionally, the text pair extraction prompts may include system examples, constraint information, etc. System examples can be pre-designed and provided as references for the large model to achieve its task objective. Constraint information may include information that the large model needs to pay attention to during the generation of execution results, such as the output format of the execution results and the requirements to be met.
[0095] For example, here is an example of text extracting prompt words:
[0096] "Please extract the {source language}-{target language} terms from the following text pairs."
[0097] Here is an example: {Example}
[0098] Notice:
[0099] --Terminology refers to the people, entities, and specific words used in a particular field.
[0100] --Designated personnel should directly copy and express in English.
[0101] --If there are no terms, simply return "None".
[0102] {Prototype}:{Prototype Sentence}
[0103] {Target Language}:{Target Language Sentence}”
[0104] The example text for extracting prompts provides the task objective: "Please extract the {Source Language}-{Target Language} terms from the following text pairs." {Source Language} is used to insert the source language used in the source text, and {Target Language} is used to insert the target language. {Source Language Sentence} represents the source text slot used for inserting the source text. {Target Language Sentence} represents the target text slot used for inserting the target text. The "Note" section provides three constraints: "Terms refer to named persons, entities, and specific words used in a specific domain," "Designated persons should be directly copied and expressed in English," and "If no clause is specified, return 'None'." {Example} is used to add examples of one or more text pairs to be extracted.
[0105] For example, here's an example of extracting "Chinese-English" text pairs from source Chinese text and target English text:
[0106] "Chinese: Someone made a statement equivalent to this, to pass on to future generations, to help them build artificial intelligence or to help them understand human intelligence, as follows: Intelligence should be viewed as a physical process that attempts to maximize freedom of action in the future and avoid constraints in its own future."
[0107] English:Someone's equivalent of that statement to pass on to descendants to help them build artificial intelligences or to help t hem understand human intelligence,is the following:Intelligence sho uld be viewed as a physical process that tries to maximize future
[0108] freedom of action and avoid co-traints in its own future.
[0109] Chinese-English Terms: / / Chinese-English text pairs
[0110] Artificial intelligence
[0111] physical process
[0112] Freedom of action.
[0113] For example, here is an example of extracting "English-Chinese" text pairs from the original English text and the target Chinese text:
[0114] "English: Someone's equivalent of that statement to pass on to descendants to help them build artificial intelligences or to help them understand human intelligence, is the following: Intelligence should be viewed as a physical process that tries to maximize future freedom of action and avoid co nstraints in its own future.
[0115] The equivalent statement that someone would pass on to future generations to help them build artificial intelligence or understand human intelligence is as follows: Intelligence should be viewed as a physical process that attempts to maximize freedom of action in the future and avoid constraints in its own future.
[0116] English-Chinese Terms: / / English-Chinese text pairs
[0117] Artificial intelligence
[0118] physical process
[0119] "Freedom of action"
[0120] Optionally, when generating translated text pairs of customized terms contained in the original text, entity names can be extracted from the original text using a large model as the customized terms contained in the original text, and the entity names can be used as the source language text of the customized terms. Further, the target language text of the customized terms is determined through manual annotation. The large model can be implemented using any natural language processing model, such as LLM; this embodiment does not impose specific limitations.
[0121] After generating translation text pairs of the custom words contained in the original text, training data is constructed based on the original text, the target text corresponding to the original text, the original language, the target language, and the translation text pairs of the custom words contained in the original text.
[0122] In one optional embodiment, after constructing the training data, the server can further verify whether the translated text pairs in the training data meet the quality conditions, and delete training data that does not meet the quality conditions, thereby improving the quality of the translated text pairs in the training data. The quality conditions are that the source text in the training data contains the source language text in the translated text pairs, and the target text in the training data contains the target language text in the translated text pairs.
[0123] Step S403: Use the training data to fine-tune the pre-trained text translation model to obtain the trained text translation model.
[0124] The training data includes: the original text, the target text corresponding to the original text, the original language, the target language, and the translated text pairs containing custom vocabulary in the original text.
[0125] In this embodiment, the text translation model is fine-tuned using an autoregressive language modeling task as the training objective. In this step, training data is input into the pre-trained text translation model, which then generates predictions of the target text from the training data.
[0126] For example, the server can obtain pre-configured training prompts for external knowledge intervention during fine-tuning training. These prompts include: a task objective, slots corresponding to the source text, the target text corresponding to the source text, the source language, the target language, and the translated text pairs containing custom vocabulary from the source text. The task objective indicates the function of the prompt, that is, prompting the model to translate the source text in the given source language into translated text in the target language. The slots in the training prompts are placeholders used to insert corresponding information. Specifically, the training prompts include: a source text slot for inserting the source text to be translated; a target text slot for inserting the target text corresponding to the source text; a source language slot for inserting the source language; a target language slot for inserting the target language; and a translated text pair slot for inserting the translated text pairs containing custom vocabulary from the source text. Additionally, the training prompts may also include system examples, constraint information, etc. System examples can be pre-designed and provided to offer reference examples for the model to achieve the task objective. Constraint information can include information that the model needs to pay attention to during the generation of execution results, such as the output format of the execution results and the requirements that need to be met.
[0127] In the process of generating prediction results using a pre-trained text translation model, multiple time steps are iterated. In the first time step, based on the source text, source language, target language, translated text pairs containing custom vocabulary from the source text, and a given starting tag, the first text tag of the target text is predicted. In subsequent time steps, based on the source text, source language, target language, translated text pairs containing custom vocabulary from the source text, and the first few known text tags in the target text, the next text tag is predicted. Finally, the predicted result of the target text is obtained.
[0128] The prediction results for the target text include: q(x) i |x <i The translation of the target text (or the target text) is based on the original text (org), the translated text pair (kno) containing custom vocabulary, and the first i-1 text tags (represented as x) in the target text. <i ), predicting the i-th text tag of the target text (i.e., x). i The probability of ).
[0129] Furthermore, the language modeling loss is calculated based on the prediction results of the target text. For example, the following formula (1) can be used to calculate the language modeling loss based on the prediction results of the target text: L=-∑ org,kno∈D ∑ i log(q(x i |x <i ,org,kno)) formula (1)
[0130] Where L represents the language modeling loss. D represents the set of training data. org,kno∈D represents the translated text pair based on the original text and the custom vocabulary contained in the original text in any training data. q(x i |x <i (org,kno) represents the translated text pair based on the original text org, the custom vocabulary contained in the original text kno, and the first i-1 text tags x in the target text. <i The i-th text tag x of the target text is predicted. i The probability of.
[0131] In addition, the calculation method of language modeling loss can also be derived from formula (1) by modifying it, for example, changing logarithmic operation to exponential operation, etc. The specific design and adjustment can be made according to the actual application requirements, and no specific limitation is made here.
[0132] Furthermore, based on the language modeling loss, the parameters of the pre-trained speech translation model are adjusted to obtain the trained speech translation model.
[0133] It should be noted that the training strategies used for fine-tuning the speech translation model, including the learning rate and optimization algorithms, can be designed and adjusted according to the actual application requirements, and no specific limitations are made here.
[0134] The method in this embodiment acquires text translation data, which includes the original text and the target text in the target language corresponding to the original text; constructs training data based on the text translation data, which includes: the original text, the target text corresponding to the original text, the original language, the target language, and the translated text pairs containing customized vocabulary in the original text; and uses the training data to fine-tune the pre-trained text translation model to obtain a trained text translation model, thereby enabling the text translation model to acquire the ability to be intervened by external knowledge.
[0135] In one alternative embodiment, the server constructs the training data as follows:
[0136] Obtain a pre-built prompt sample library, which includes one or more prompt word samples that implement text translation based on external knowledge intervention. Sample one or more prompt word samples from the prompt sample library, insert the prompt word samples into the translated text pairs of the original text, the original language, the target language, and the customized vocabulary contained in the original text, and generate corresponding task instruction samples. Combine the task instruction samples and the target text corresponding to the original text to form training data.
[0137] Optionally, after constructing the training data, the server can also verify whether the translated text pairs in the task instruction samples of the training data meet the quality conditions, and delete training data in the task instruction samples whose translated text pairs do not meet the quality conditions, so as to improve the quality of the translated text pairs in the training data. The quality conditions are that the source text in the task instruction samples of the training data contains the source language text in the translated text pairs, and the target text contains the target language text in the translated text pairs.
[0138] When fine-tuning the text translation model, task instruction samples are input into the text translation model, and the pre-trained text translation model generates translation results based on the task instruction samples. Based on the differences between the translation results and the target text corresponding to the original text, the parameters of the pre-trained text translation model are adjusted to obtain the trained text translation model.
[0139] For example, Figure 5 is a framework diagram for constructing training data provided in this embodiment. As shown in Figure 5, the process framework for constructing training data is as follows: First, based on the pre-constructed prompt sample library, prompt word samples are sampled; training data is generated based on bilingual translation data and prompt word samples. Specifically, based on the bilingual translation data, the translated text pairs of the original text, target text, original language, target language, and customized vocabulary contained in the original text are determined. The translated text pairs of the original text, original language, target language, and customized vocabulary contained in the original text are inserted into the sampled prompt word samples to obtain task instruction samples; training data including task instruction samples and target text is constructed. Further, the training data is filtered according to whether the translated text pairs in the training data meet the quality conditions, and training data whose translated text pairs do not meet the quality conditions are deleted to obtain the final training dataset used for fine-tuning training.
[0140] Figure 6 is a flowchart of a method for constructing a translation database according to an exemplary embodiment of this disclosure. As shown in Figure 6, the translation database can be constructed in the following manner:
[0141] Step S601: Obtain the translation text pair of at least one custom word to be added to the translation database.
[0142] The customized vocabulary to be added to the translation knowledge base may include proper nouns, technical terms, and recently emerging new words in the field where the text translation model is applied. The specific vocabulary can be customized by relevant personnel according to the actual application needs. This embodiment does not make specific limitations here.
[0143] Optionally, in response to a request to add translated text pairs to the translation database, the server displays a vocabulary customization interface. Users can enter at least one customized vocabulary translation text pair on the server-provided vocabulary customization interface. The server then retrieves the translated text pair of at least one customized vocabulary to be added to the translation database, entered through the vocabulary customization interface.
[0144] Optionally, relevant personnel can also upload a customized vocabulary file through the front-end interface provided by the server. The customized vocabulary file records the translation text pair of at least one customized vocabulary to be added to the translation database. The server receives the customized vocabulary file uploaded through the front-end interface and reads the translation text pair of at least one customized vocabulary to be added to the translation database from the customized vocabulary file.
[0145] In addition, the method for obtaining the translated text pairs of custom words to be added to the translation database can be configured and adjusted according to actual application needs, and no specific limitations are made here.
[0146] Step S602: Add at least one translation text pair of a customized term to the translation database.
[0147] After obtaining at least one translated text pair for a custom term, the server adds the translated text pair for that custom term to the translation database. Additionally, the translation database can also store the source and target languages corresponding to the translated text pairs for each custom term.
[0148] In practical applications, multiple source-target language pairs can be pre-configured, allowing the constructed translation database to include multiple source-target language translation text pairs for the same customized vocabulary. This makes it suitable for text translation scenarios with different translation needs (different source-target languages). For example, the translation database can simultaneously store multiple source-target language translation text pairs such as "Chinese-English", "English-Japanese", "English-Chinese", and "Japanese-Chinese" for the same customized vocabulary.
[0149] The method in this embodiment can also be applied to expand the translation database. It can obtain the translation text pair of at least one customized term to be expanded at any time and add it to the translation database. In addition, it also supports the modification and deletion of the translation text pair of any customized term in the translation database.
[0150] The method in this embodiment obtains a translation text pair of at least one customized word to be added to the translation database, and adds the translation text pair of at least one customized word to the translation database. This can build a translation database applicable to any field or translation scenario, and supports expansion of the translation database at any time. This allows the translation database to cover customized words such as professional terms, technical terms, and new words required in various fields / scenarios, effectively avoiding translation errors of these customized words, improving the translation accuracy of the text translation model for these customized words, and thus improving the accuracy of the translation results.
[0151] Figure 7 is a flowchart of a text translation method provided in another exemplary embodiment of this disclosure. As shown in Figure 7, the specific steps of the method are as follows:
[0152] Step S701: Receive a translation request sent by the receiving end device. The translation request includes the original text to be translated and the target language to be translated.
[0153] This embodiment applies to a machine translation scenario. Users can input the original text to be translated via a device, specify the target language, and send a translation request to the server. The translation request includes the original text to be translated and the target language.
[0154] The server receives translation requests sent by the end-user device and extracts the original text to be translated and the target language to be translated from the translation request.
[0155] Step S702: Search the translation database for translation text pairs that match the original text. The translation database includes translation text pairs of at least one customized term. Each translation text pair includes the source language text and the target language text of the customized term.
[0156] The implementation principle of this step is the same as that of the aforementioned step S202. For the specific implementation principle, please refer to the relevant content of the aforementioned embodiments, which will not be repeated here.
[0157] Step S703: Input the original text and the translated text into the text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
[0158] The implementation principle of this step is the same as that of step S203 mentioned above. For the specific implementation principle, please refer to the relevant content of the aforementioned embodiments, which will not be repeated here.
[0159] Step S704: Return the translated text in the target language to the end device.
[0160] After obtaining the translated text in the target language, the server returns the translated text in the target language to the end device.
[0161] The implementation principle and technical effects of this embodiment are the same as those in the foregoing embodiments, and will not be repeated here.
[0162] The method in this embodiment receives a translation request from an end-user device. The translation request includes the original text to be translated and the target language to be translated. It searches a translation database for a matching translation text pair. The translation database includes at least one translation text pair for a custom term, and each translation text pair includes the source language text and the target language text for the custom term. The original text and the translation text pair are then input into a text translation model. The text translation model translates the source language text appearing in the original text into the corresponding target language text and generates the translated text in the target language. Based on a pre-built translation database, external knowledge intervention can be applied to the text translation model. This effectively avoids translation errors of custom terms without retraining the parameters of the text translation model, improving the accuracy of the text translation model in translating custom terms such as proper nouns, technical terms, and neologisms, thereby improving the accuracy of the translation results.
[0163] Figure 8 is a schematic diagram of a server structure provided in an embodiment of this disclosure. As shown in Figure 8, the server includes a memory 801 and a processor 802. The memory 801 is used to store computer execution instructions and can be configured to store various other data to support operations on the server. The processor 802 is communicatively connected to the memory 801 and is used to execute the computer execution instructions stored in the memory 801 to implement the technical solutions provided in any of the above method embodiments. Their specific functions and the technical effects they can achieve are similar and will not be repeated here.
[0164] Optionally, as shown in Figure 8, the server may also include other components such as a firewall 803, a load balancer 804, a communication component 805, and a power supply component 806. Figure 8 only schematically illustrates some components and does not imply that the server only includes the components shown in Figure 8. Figure 8 uses a cloud server deployed in the cloud as an example for illustrative purposes; the server can also be deployed locally, and this embodiment does not impose specific limitations.
[0165] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the method of any of the foregoing embodiments. The specific functions and technical effects to be achieved are not described here.
[0166] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the methods of any of the foregoing embodiments. The computer program is stored in a readable storage medium, and at least one processor of the server can read the computer program from the readable storage medium. The execution of the computer program by the at least one processor causes the server to perform the technical solutions provided in any of the above method embodiments; the specific functions and achievable technical effects are not elaborated here.
[0167] This disclosure provides a chip, including a processing module and a communication interface. The processing module is capable of executing the technical solutions of the server in the aforementioned method embodiments. Optionally, the chip further includes a storage module (e.g., a memory), which stores instructions. The processing module executes the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solutions provided in any of the aforementioned method embodiments.
[0168] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this disclosure.
[0169] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), a graphics processing unit (GPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules in at least one processor.
[0170] The memory may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0171] The aforementioned storage device can be object storage service (OSS).
[0172] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0173] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as mobile hotspots (WiFi), second-generation (2G), third-generation (3G), fourth-generation (4G) / Long Term Evolution (LTE), fifth-generation (5G), or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), infrared, Ultra Wide Band (UWB), Bluetooth, and other technologies.
[0174] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0175] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0176] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside within an application-specific integrated circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components within an electronic device or host device.
[0177] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0178] The order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order; however, it should be clearly understood that these operations may not be executed in the order they appear herein or may be executed in parallel. The sequence numbers are merely used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types. "Multiple" means two or more, unless otherwise explicitly specified.
[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solutions of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this disclosure.
[0180] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0181] The above are merely preferred embodiments of this disclosure and do not limit the patent scope of this disclosure. Any equivalent structural or procedural transformations made using the content of this disclosure and its drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this disclosure.
Claims
1. A method of translating text, wherein, include: Obtain the original text to be translated and the target language to be translated into; Search a translation database for translation text pairs that match the original text. The translation database includes translation text pairs containing at least one custom term, and the translation text pairs include source language text and target language text. The original text, the target language, and the translated text are input into a text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
2. The method of claim 1, wherein, The step of searching the translation database for translated text pairs that match the original text includes: The original text is matched with the original language text contained in the translated text pairs in the translation database to determine the translated text pairs in the original text that contain the original language text, thus obtaining the translated text pairs that match the original text.
3. The method of claim 1, wherein, The step of inputting the original text, the target language, and the translated text into a text translation model, which translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text in the target language corresponding to the original text, includes: The original text, the target language, and the translated text pair are inserted into a prompt word to generate a task instruction. The task instruction is used to prompt the text translation model to generate a translated text of the target language of the original text based on the translated text pair. The task instruction is input into the text translation model. Based on the prompts of the task instruction, the text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
4. The method of any one of claims 1-3, wherein, The training process of the text translation model includes: Acquire text translation data, which includes the original text and the target text in the target language corresponding to the original text; Based on the text translation data, training data is constructed, which includes: the original text, the target text corresponding to the original text, the original language used in the original text, the target language, and the translation text pairs of customized words contained in the original text; Using the training data, the pre-trained text translation model is fine-tuned to obtain a fully trained text translation model.
5. The method of claim 4, wherein, The step of constructing training data based on the text translation data includes: Using a text pair extraction model, translation text pairs of customized words are extracted from the original text and the target text corresponding to the original text, to obtain translation text pairs of customized words contained in the original text. The translation text pairs of customized words contain the original language text and the target language text of the customized words. Training data is constructed based on the original text, the target text corresponding to the original text, the original language, the target language, and the translated text pairs containing customized vocabulary in the original text.
6. The method of claim 5, wherein, Also includes: Verify whether the translated text pairs in the training data meet the quality conditions, wherein the quality conditions are that the original text in the training data contains the original language text in the translated text pair, and the target text in the training data contains the target language text in the translated text pair; Delete training data that does not meet the quality conditions.
7. The method of claim 4, wherein, The step of using the training data to fine-tune the pre-trained text translation model to obtain a fully trained text translation model includes: The training data is input into the pre-trained text translation model, and the pre-trained text translation model generates a prediction result of the target text in the training data. Based on the prediction results of the target text, the parameters of the pre-trained text translation model are adjusted to obtain the trained text translation model.
8. The method of any one of claims 1-3, wherein, Also includes: Obtain the translation text pair for at least one custom word to be added to the translation database; Add the translation text pair of the at least one customized word to the translation database.
9. The method of claim 8, wherein, The process of obtaining a translated text pair of at least one custom word to be added to the translation database includes: In response to a request to add a translation text pair to the translation database, a vocabulary customization interface is displayed, and a translation text pair of at least one customized vocabulary to be added to the translation database is obtained by inputting through the vocabulary customization interface. And / or, Receive a customized vocabulary file uploaded through the front-end interface, and read the translation text pair of at least one customized vocabulary to be added to the translation database from the customized vocabulary file.
10. A method of translating text, wherein, include: The receiving end device sends a translation request, which includes the original text to be translated and the target language to be translated into; Search a translation database for a translation text pair that matches the original text. The translation database includes at least one translation text pair for a custom word, and the translation text pair includes the source language text and the target language text of the custom word. The original text and the translated text are input into the text translation model. The text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text. The translated text in the target language is returned to the terminal device.
11. The method of claim 10, wherein, The step of searching the translation database for translated text pairs that match the original text includes: The original text is matched with the original language text contained in the translated text pairs in the translation database to determine the translated text pairs in the original text that contain the original language text, thus obtaining the translated text pairs that match the original text.
12. The method of claim 10, wherein, The input text translation model, which pairs the original text and the translated text, translates the source language text appearing in the original text into the corresponding target language text, and generates the translated text in the target language corresponding to the original text, includes: The original text, the target language, and the translated text pair are inserted into a prompt word to generate a task instruction. The task instruction is used to prompt the text translation model to generate a translated text of the target language of the original text based on the translated text pair. The task instruction is input into the text translation model. Based on the prompts of the task instruction, the text translation model translates the original language text appearing in the original text into the corresponding target language text, and generates the translated text of the target language corresponding to the original text.
13. The method according to any one of claims 10-12, wherein, The training process of the text translation model includes: Acquire text translation data, which includes the original text and the target text in the target language corresponding to the original text; Based on the text translation data, training data is constructed, which includes: the original text, the target text corresponding to the original text, the original language used in the original text, the target language, and the translation text pairs of customized words contained in the original text; Using the training data, the pre-trained text translation model is fine-tuned to obtain a fully trained text translation model.
14. The method of claim 13, wherein, The step of constructing training data based on the text translation data includes: Using a text pair extraction model, translation text pairs of customized words are extracted from the original text and the target text corresponding to the original text, to obtain translation text pairs of customized words contained in the original text. The translation text pairs of customized words contain the original language text and the target language text of the customized words. Training data is constructed based on the original text, the target text corresponding to the original text, the original language, the target language, and the translated text pairs containing customized vocabulary in the original text.
15. The method of claim 14, further comprising: Verify whether the translated text pairs in the training data meet the quality conditions, wherein the quality conditions are that the original text in the training data contains the original language text in the translated text pair, and the target text in the training data contains the target language text in the translated text pair; Delete training data that does not meet the quality conditions.
16. The method of claim 13, wherein, The step of using the training data to fine-tune the pre-trained text translation model to obtain a fully trained text translation model includes: The training data is input into the pre-trained text translation model, and the pre-trained text translation model generates a prediction result of the target text in the training data. Based on the prediction results of the target text, the parameters of the pre-trained text translation model are adjusted to obtain the trained text translation model.
17. The method of any one of claims 10-12, wherein, Also includes: Obtain the translation text pair for at least one custom word to be added to the translation database; Add the translation text pair of the at least one customized word to the translation database.
18. A server, wherein, include: At least one processor; as well as A memory that is communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the server to perform the method according to any one of claims 1-17.
19. A computer readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-17.
20. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-17.