Translation optimization method and system of knowledge graph assisted semantic enhancement translation model

By dividing the translation model and knowledge graph into multiple semantic blocks and using a mesh network for distributed collaborative retrieval, the problems of translation speed and accuracy in semantically enhanced translation models are solved, enabling translation and retrieval to proceed simultaneously and improving overall translation efficiency.

CN120725033BActive Publication Date: 2025-11-18四川吉利学院
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511251735.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-11-18
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

Existing technologies struggle to simultaneously achieve both translation accuracy and speed, especially in large-scale knowledge graphs where the low retrieval efficiency of semantically enhanced translation models leads to a decrease in translation speed.

Method used

By dividing the translation model and knowledge graph into multiple semantic blocks and using a mesh network for distributed collaborative retrieval, translation and retrieval tasks are performed synchronously. The translation process is optimized by utilizing tag classification and caching space, thus achieving simultaneous translation and retrieval.

Benefits of technology

It improved the overall translation and retrieval speed, enhanced the overall translation efficiency of the translation model, and maintained the accuracy of the translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120725033B_ABST
    Figure CN120725033B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of natural language processing, and particularly relates to a translation optimization method and system of a knowledge graph assisted semantic enhancement translation model. Through classification of the text to be translated, direct text translation is performed on the text segment without entity retrieval, and at the same time, knowledge graph retrieval is synchronously completed through a distributed collaborative retrieval architecture built by a mesh network. Finally, according to the retrieval result, the text segment requiring entity retrieval is translated and stored, and the final translation result is output through data fusion. On the one hand, the application adopts the mode of synchronous translation and retrieval to improve the overall translation rate, and on the other hand, the distributed collaborative retrieval architecture based on the mesh network can further improve the retrieval rate while realizing accurate retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The technical field relates to natural language processing, and particularly relates to a translation optimization method and system for a knowledge graph assisted semantic enhancement translation model. BACKGROUND

[0002] A knowledge graph is a structured semantic knowledge base that models knowledge of the real world through entities, relationships, and attributes. A semantic enhancement translation model is a model that introduces semantic level information (such as contextual meaning, domain knowledge) on the basis of a traditional machine translation model (such as Transformer) to improve translation accuracy. When translating text, the semantic enhancement translation model may retrieve a knowledge graph to obtain the meaning of the same word in different contexts, obtain the meaning of a professional vocabulary in the field to which it belongs, and obtain the implied logical relationship in a long sentence, in the case of resolving ambiguities of polysemous words, supplementing professional domain knowledge, and reasoning semantic logic relationships. If there is no entity in the translated text that needs to be supplemented with knowledge (such as the ordinary daily language "today the weather is very good"), the semantic enhancement translation model skips the knowledge graph retrieval environment and directly translates the text.

[0003] With the continuous updating of the knowledge graph, the corpus of the knowledge graph is more abundant, which is conducive to improving the translation accuracy of the semantic enhancement translation model. However, as the size of the knowledge graph gradually increases (existing knowledge graphs usually contain billions of entities and relationships), the efficiency of the semantic enhancement translation model in retrieving the knowledge graph gradually decreases, thereby affecting the translation rate of the semantic enhancement translation model. SUMMARY

[0004] The technical problem to be solved by the present application is that the prior art cannot simultaneously consider translation accuracy and translation rate.

[0005] To solve the above technical problems, the present application realizes the following technical solutions:

[0006] In a first aspect, a translation optimization method for a knowledge graph assisted semantic enhancement translation model is provided, comprising the following steps:

[0007] On the side of the translation model: extracting a scan result and a retrieval list from the semantic enhancement translation model; the scan result contains multiple text segments after segmentation, and the retrieval list contains multiple retrieval tasks; adding a first label or a second label to each text segment according to the retrieval list; the first label indicates that the text segment can be directly translated, and the second label indicates that the text segment needs to retrieve an entity; assigning a corresponding cache space to each text segment according to the position of the text segment in the text to be translated; translating the text segments with the first label one by one, storing the translation results in the corresponding cache space, and sending the retrieval list to the side of the knowledge graph;

[0008] On the knowledge graph side: the knowledge graph is divided into multiple semantic blocks; the retrieval list is sent to each semantic block; within each semantic block: a semantic tag set for the semantic block is generated; the similarity between each retrieval task and the semantic tag set is calculated, and a similarity list is established; the similarity list is sent to each of the remaining semantic blocks through a mesh network; the similarity list of the current semantic block is merged with all received similarity lists to establish a task matching list; the optimal retrieval task for the current semantic block is queried from the task matching list; the optimal retrieval task is executed, and the retrieval results are fed back to the translation model side;

[0009] On the translation model side: each text segment with a second tag is translated based on the retrieval results fed back from each semantic block, and the translation results are stored in the corresponding cache space; the translation results of all cache spaces are merged according to the position number to obtain the final translation result.

[0010] Secondly, a translation optimization system for a knowledge graph-assisted semantic enhancement translation model is provided, including:

[0011] The data acquisition module is used to extract scanning results and retrieval lists from the semantically enhanced translation model; the scanning results contain multiple segmented text fragments, and the retrieval lists contain multiple retrieval tasks.

[0012] The tagging module is used to add a first tag or a second tag to each text fragment based on the search list; the first tag indicates that the text fragment can be directly translated, and the second tag indicates that the text fragment requires entity retrieval;

[0013] The cache allocation module is used to allocate corresponding cache space for each text segment based on its position in the text to be translated;

[0014] The first data sending module is used to send the search list to the knowledge graph side;

[0015] The first translation module is used to translate text segments with the first tag one by one and store the translation results in the corresponding cache space.

[0016] The knowledge graph partitioning module is used to divide the knowledge graph into multiple semantic blocks;

[0017] The second data sending module is used to distribute the retrieval list to each semantic block;

[0018] The tag set generation module is used to generate the semantic tag set for the semantic block;

[0019] The similarity calculation module is used to calculate the similarity between each retrieval task and the semantic tag set, and to build a similarity list;

[0020] The mesh communication module is used to send the similarity list to each of the remaining semantic blocks through the mesh network;

[0021] The first data fusion module is used to merge the similarity list of this semantic block with all received similarity lists to establish a task matching list;

[0022] The task query module is used to query the optimal retrieval task for this semantic block from the task matching list;

[0023] The task execution module is used to execute the optimal retrieval task;

[0024] The third data sending module is used to feed back the search results to the translation model.

[0025] The second translation module is used to translate each text segment with a second tag based on the retrieval results fed back by each semantic block, and store the translation results in the corresponding cache space;

[0026] The second data fusion module is used to merge the translation results of all cached spaces according to the location number to obtain the final translation result.

[0027] Thirdly, a computer device is proposed, comprising a memory, a processor, and a transceiver connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive data, and the processor is used to read the computer program and execute a translation optimization method for a knowledge graph-assisted semantic enhancement translation model as described in the first aspect.

[0028] Fourthly, a computer-readable storage medium is proposed, on which instructions are stored, which, when executed on a computer, perform a translation optimization method for a knowledge graph-assisted semantic enhancement translation model as described in any of the first aspects.

[0029] Fifthly, a computer program product containing instructions is proposed, which, when executed on a computer, causes the computer to perform a translation optimization method for a knowledge graph-assisted semantic enhancement translation model as described in the first aspect; the computer includes: a general-purpose computer, a special-purpose computer, or a programmable device.

[0030] Compared with the prior art, the present invention has the following advantages and beneficial effects: on the one hand, the method of simultaneous translation and retrieval can improve the overall translation speed; on the other hand, the distributed collaborative retrieval architecture based on mesh network can achieve accurate retrieval while further improving the retrieval speed. Attached Figure Description

[0031] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0032] Figure 1 This is a schematic diagram of a translation optimization method for a knowledge graph-assisted semantic enhancement translation model provided in Embodiment 1 of the present invention.

[0033] Figure 2 This is a schematic diagram of a translation optimization system architecture for a knowledge graph-assisted semantic enhancement translation model provided in Embodiment 1 of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. The illustrative embodiments and descriptions of this invention are for illustrative purposes only and are not intended to limit the invention. The embodiments described below are some, but not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0035] In the following description, numerous specific details are set forth to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other embodiments, well-known structures, materials, or methods are not specifically described to avoid obscuring the invention. Unless otherwise specified, the materials, instruments, and reagents used in the following embodiments are commercially available. Unless otherwise specified, the techniques used in the embodiments are conventional methods well known to those skilled in the art.

[0036] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0037] Example 1: A translation optimization method for a knowledge graph-assisted semantic enhancement translation model is provided, including... Figure 1 The following steps are shown:

[0038] On the translation model side, perform steps 1 through 4.

[0039] Step 1: Extract the scan results and retrieval list from the semantically enhanced translation model.

[0040] As is well known, before translating long texts, semantically enhanced translation models first perform a one-time scan of the text to be translated, dividing it into multiple text segments by sentences or paragraphs to generate a "scan result". Then, they use Named Entity Recognition (NER) technology to extract potential entities (such as names of people, places, terms, etc.) from each text segment, forming an "entity list". Next, they perform batch classification of the entity list based on a knowledge graph to determine which entities need to be retrieved from the knowledge graph, forming a "retrieval list". Finally, they use a static fusion model or a dynamic retrieval model to obtain entity information from the knowledge graph.

[0041] It should be noted that: 1. The retrieval list contains multiple retrieval tasks, each containing entities and entity types. 2. Static fusion models pre-encode the semantic information of the knowledge graph into the model parameters, directly using the pre-trained parameters during translation without real-time knowledge graph retrieval. 3. Dynamic retrieval models dynamically retrieve relevant entity information from the knowledge graph based on the current sentence during translation before generating the translation result.

[0042] Step 2: Add a first tag or a second tag to each text fragment based on the search list.

[0043] The first label indicates that the text fragment can be directly translated, while the second label indicates that the text fragment requires entity retrieval.

[0044] Specifically, based on the explanation in step 1, the semantically enhanced translation model needs to determine which entities in the entity list require retrieval from the knowledge graph, thus forming a retrieval list. Therefore, if a text fragment contains an entity from the retrieval list, a second tag is added to the text fragment; if the text fragment does not contain an entity from the retrieval list, a first tag is added to the text fragment. The specific method is as follows: for each text fragment, steps 2.1 to 2.3 are executed.

[0045] Step 2.1: Extract all entities from the text fragment.

[0046] Extracting entities from text is an important task in natural language processing, often referred to as named entity recognition. Since entity extraction from text fragments is an existing technique, it will not be elaborated upon in this embodiment.

[0047] Step 2.2: Match each entity with each retrieval task.

[0048] This step involves matching the entities extracted from the text fragment with the entities in the retrieval task. Matching can be done by directly comparing whether the strings of the two entities are identical or similar. This includes exact matching and fuzzy matching. Exact matching checks if the string of the entity extracted from the text fragment is exactly the same as the string of the entity in the retrieval task. If they are identical, the match is successful; otherwise, the match fails. Fuzzy matching uses string similarity algorithms (such as the Levenshtein distance calculation model or the Jaro-Winkler distance calculation model) to measure the similarity between the string of the entity extracted from the text fragment and the string of the entity in the retrieval task. If the similarity is greater than a threshold, the match is successful; if the similarity is less than the threshold, the match fails.

[0049] Step 2.3: If none of the entities exist in any retrieval task, add a first tag to the text fragment; if at least one entity exists in one or more retrieval tasks, add a second tag to the text fragment.

[0050] Step 2 categorizes all scanned text fragments into two types. One type consists of text fragments that can be directly translated without prior knowledge graph retrieval; the other type requires prior knowledge graph retrieval, followed by translation using the retrieved entity information. Furthermore, the purpose of classifying all scanned text fragments in Step 2 is to allow the semantically enhanced translation model to translate the text fragments with the first label first, thereby improving the overall translation speed. Specifically, existing translation models employ a sequential translation mode. The translation model starts from the first text fragment of the target text and executes the translation task for each text fragment sequentially. Before each translation task, it determines whether the entities in the current text fragment require knowledge graph retrieval. If so, it obtains entity information from the knowledge graph through a static fusion model or a dynamic retrieval model, and translates the current text fragment using the retrieved entity information, then continues with subsequent translation tasks. If not, it directly translates the current text fragment and then continues with subsequent translation tasks. Therefore, when using existing translation models for text translation, if the translation model detects that the entity in the current text segment requires retrieval from the knowledge graph, all subsequent text segments (including those that do not require knowledge graph retrieval and those that do) are in a waiting state. Thus, the translation rate of sequential translation depends on the knowledge graph retrieval rate. If the knowledge graph is too large, the retrieval rate decreases, consequently reducing the overall translation rate of the translation model.

[0051] Step 2 involves dividing all scanned text fragments into two categories and adding corresponding labels to each category. This allows the translation model to identify the labels and prioritize translating the text fragments with the first label, thereby shortening the waiting time and improving the overall translation speed. For example, if a text to be translated is divided into 10 sequential text fragments, and the semantically enhanced translation model determines that entities in fragments 3, 5, and 7 require knowledge graph retrieval (with a second label), the logic of the sequential translation mode is as follows: First, translate fragments 1, 2, and 3 in sequence. For fragments 1 and 2 (with the first label), direct text translation is used. Before translating fragment 3, the knowledge graph is retrieved, and then the third text fragment is translated based on the retrieved entity information. In this scenario, the retrieval process for the third text fragment adds extra waiting time for the fourth, sixth, eighth, and tenth text fragments (with the first tag) (the retrieval time for the third text fragment); similarly, the retrieval process for the fifth text fragment adds extra waiting time for the sixth, eighth, and tenth text fragments. However, since the fourth, sixth, eighth, and tenth text fragments can be translated directly, there is no need to increase the time cost of searching the knowledge graph. Therefore, the sequential translation mode increases the overall translation time and reduces the overall translation rate. In contrast, step 2 divides all scanned text fragments into two categories and adds corresponding text tags to each category. This allows the semantically enhanced translation model to identify the tags and prioritize translating all text fragments with the first tag, thus avoiding extra waiting time for these fragments and shortening the overall translation time, thereby improving the overall translation rate. For example, the semantically enhanced translation model can prioritize direct text translation of text fragments 1, 2, 4, 6, 8, and 10, reducing their waiting time.

[0052] Step 3: Allocate corresponding cache space for each text segment based on its position in the text to be translated.

[0053] Similarly, based on the explanation in step 1, the semantically enhanced translation model first performs a one-time scan of the text to be translated before translating long texts. This scan divides the text into multiple text segments, either sentences or paragraphs, and each segment has a corresponding position within the text to be translated. For example, if a text to be translated is divided into 100 text segments, the position of the first segment can be marked as 1, the position of the second segment as 2, and so on.

[0054] Furthermore, based on the explanation in step 2, the semantically enhanced translation model will first translate the text segments with the first label. Therefore, the purpose of step 3 is to temporarily store the translation results obtained from the first translation and reserve cache space for text segments with the second label. Specifically, since each cache space is allocated according to the position of each text segment in the text to be translated, each cache space also has a corresponding sequential number. For example, the cache space corresponding to the first text segment is numbered 1, the cache space corresponding to the second text segment is numbered 2, and so on. Therefore, for text segments with the first label, after storing their translation results in the corresponding cache space, the remaining cache spaces are reserved for text segments with the second label. After storing the translation results of text segments with the second label in the corresponding cache space, the numbering of each cache space ensures that the order of all translation results is consistent with the order of the corresponding text segments in the text to be translated. This facilitates the subsequent fusion of all translation results, ensuring that the overall word order of the fused translation is consistent with the overall word order of the text to be translated.

[0055] Step 4: Translate each text segment with the first tag, store the translation results in the corresponding cache space, and send the retrieval list to the knowledge graph side.

[0056] Building upon steps 1 to 3, step 4 aims to synchronize translation and retrieval, avoiding additional waiting time for text segments with the first tag and thus improving the overall translation speed. Specifically, when the semantically enhanced translation model begins translating text segments with the first tag, it simultaneously sends a retrieval list to the knowledge graph, triggering the knowledge graph to execute a retrieval task based on the list. This allows the knowledge graph to simultaneously perform a retrieval task while the translation model translates text segments one by one, and feeds back the retrieved entity information to the translation model, triggering it to translate text segments with the second tag based on the entity information. It should be noted that because the retrieval task on the knowledge graph side and the translation task on the translation model side are performed synchronously, the translation model can also translate text segments with the second tag synchronously after receiving entity information from the knowledge graph, further reducing translation time.

[0057] On the knowledge graph side, perform steps 5 through 13:

[0058] Step 5: Divide the knowledge graph into multiple semantic blocks.

[0059] The purpose of dividing the knowledge graph into multiple semantic blocks is to prepare for subsequent distributed retrieval operations on the knowledge graph side. The specific method is as follows:

[0060] Step 5.1: Construct a semantic genealogy tree based on the hierarchical structure of the knowledge graph.

[0061] A semantic genealogy tree transforms the hierarchical structure of classes and attributes in a knowledge graph into a tree-like semantic network, used to intuitively express inheritance relationships, attribute dependencies, and semantic associations between concepts. A semantic genealogy tree contains multiple subtrees, each containing a parent node representing an entity type, and each parent node containing multiple child nodes representing specific entities.

[0062] The method for constructing a semantic genealogy tree is as follows:

[0063] 1. Analyze the ontology layer of the knowledge graph. This includes:

[0064] (1) Extract class hierarchy: Traverse class nodes through subClassOf relationship to construct class inheritance tree.

[0065] Knowledge graphs contain classes and subClassOf relationships. The subClassOf relationship indicates that one class is a subclass of another class, and this relationship can be used to construct hierarchical class structures.

[0066] First, store the knowledge graph in an RDF (Resource Description Framework) file, a graph database (such as Neo4j), or a table.

[0067] Then, use graph database query languages ​​(such as Cypher) or RDF query languages ​​(such as SPARQL) to extract all classes and their subClassOf relationships from the knowledge graph.

[0068] Finally, a recursive approach can be used to construct an inheritance tree from the extracted relationships: find the class without a parent class as the root node; store all classes and their subclass relationships in a dictionary, with the key being the parent class and the value being a list of subclasses; starting from the root node, recursively add its subclasses as child nodes for each parent class.

[0069] (2) Extracting attribute hierarchy: The hierarchy of object attributes and data attributes is parsed through the subPropertyOf relation.

[0070] In knowledge graphs, the subPropertyOf relation is used to represent the hierarchical structure between properties. By parsing the subPropertyOf relation, the hierarchical structure of object properties and data properties can be constructed.

[0071] First, define object attributes and data attributes. Object attributes are used to describe the relationships between entities, such as "located in" or "belongs to"; data attributes are used to describe the characteristics or data values ​​of entities, such as "age" or "color".

[0072] Then, store the knowledge graph in an RDF file, a graph database (such as Neo4j), or a table.

[0073] Next, extract the attributes and their relationships. Use a graph database query language (such as Cypher) or an RDF query language (such as SPARQL) to extract all attributes and their subPropertyOf relationships from the knowledge graph.

[0074] Next, construct the attribute hierarchy structure—store all attributes and their sub-attribute relationships in a dictionary, with the key being the parent attribute and the value being a list of sub-attributes; find the attribute without a parent attribute as the root attribute; starting from the root attribute, construct the attribute hierarchy layer by layer.

[0075] Finally, distinguish between object properties and data properties. When building a hierarchy, categorize properties based on their type (object property or data property).

[0076] (3) Obtain metadata: Collect semantic descriptions such as class label, comment, and attribute domain and range.

[0077] 2. Define the tree structure and model the nodes.

[0078] The tree structure definition includes: defining unique identifiers, defining readable names, defining classes and attributes, defining parent node reference relationships, and defining a list of child nodes. Node modeling includes: creating class nodes, creating attribute nodes, and creating metadata nodes. Class nodes contain labels, descriptions, and parent class references. Attribute nodes distinguish between object attributes (connecting classes) and data attributes (connecting data types), and contain domains and value ranges. Metadata nodes are used to attach statistical information such as the number of class instances and attribute usage frequency.

[0079] 3. Construct a semantic genealogy tree through level-order traversal.

[0080] First, determine the root node. Typically, the top-level ontology class or the domain root class is chosen as the root node.

[0081] Then, starting from the root node, subclasses and sub-attributes are expanded layer by layer. For each class node, the declared attributes are associated through domain matching to obtain a semantic genealogy tree.

[0082] It should be further noted that some entities in the knowledge graph simultaneously satisfy the definition conditions of multiple categories, or the categories to which some entities belong have a hierarchical relationship (such as parent and child classes). As a result, these entities are deployed at different class boundaries during the construction of the semantic hierarchy tree. Therefore, steps 5.2 to 5.3 need to be performed for each cross-class entity to clarify its affiliation.

[0083] Step 5.2: Obtain the similarity between cross-class entities and each parent node through the attribute semantic similarity calculation model.

[0084] This embodiment uses an ontology-based semantic similarity calculation model to obtain the similarity between cross-class entities and each parent node. The expression for the ontology-based semantic similarity calculation model is: Sim(c1,c2)=2 / (MAX-L). Where Sim(c1,c2) ​​represents the similarity between the cross-class entity and its parent node, c1 is the cross-class entity, c2 is the parent node, MAX is the maximum path length between the cross-class entity and its parent node in the semantic hierarchy tree, and L is the minimum path length between the cross-class entity and its parent node in the semantic hierarchy tree.

[0085] Furthermore, the method for determining the maximum path length MAX between a cross-class entity and its parent node in the semantic genealogy tree is as follows: Use a depth-first search algorithm to find all possible paths from the cross-class entity to its parent node; for each path, calculate its length, i.e., the number of edges on the path; select the maximum value from all path lengths, which is the maximum path length between the cross-class entity and its parent node in the semantic genealogy tree. Similarly, the method for determining the maximum path length L between a cross-class entity and its parent node in the semantic genealogy tree is as follows: Use a depth-first search algorithm to find all possible paths from the cross-class entity to its parent node; for each path, calculate its length, i.e., the number of edges on the path; select the minimum value from all path lengths, which is the minimum path length between the cross-class entity and its parent node in the semantic genealogy tree.

[0086] Step 5.3: Divide cross-class entities into the subtrees containing the parent nodes with the highest similarity, resulting in multiple semantic blocks.

[0087] Step 6: Send the search list to each semantic block separately.

[0088] Step 7: Execute steps 8 through 13 within each semantic block;

[0089] Step 8: Generate the semantic tag set for this semantic block. This includes the following steps:

[0090] Step 8.1: Use named entity recognition technology to extract the semantics corresponding to each entity from this semantic block and establish an initial semantic vector set.

[0091] Step 8.2: Use a word vector model to generate semantic labels for each vector in the initial semantic vector set, thus establishing the initial semantic label set. Commonly used word vector models include Word2Vec and BERT. Before this, a word vector model needs to be pre-trained. Taking the Word2Vec model as an example:

[0092] First, prepare the corpus. Collect a large amount of text data as training data, and preprocess the corpus, including word segmentation, stop word removal, and lowercase conversion.

[0093] Next, select a model architecture. These include the CBOW model architecture and the Skip-Gram model architecture. The CBOW model architecture predicts the target word based on the context words, while the Skip-Gram model architecture predicts the context words based on the target word.

[0094] Next, set the hyperparameters, including: the size of the context window, the dimension of the word vectors, the learning rate during training, and the number of training iterations.

[0095] Finally, the model is trained. Stochastic gradient descent (SGD) is used to train the model. During training, the model continuously adjusts the word vectors to make the relationship between context words and target words closer.

[0096] Step 8.3: Clean the initial semantic tag set to obtain the semantic tag set for this semantic block.

[0097] Data cleaning includes:

[0098] Synonyms can be combined, for example, "age", "age number", and "age years" can be combined into "age";

[0099] Abbreviations or expansions of terms, such as expanding "CEO" to "Chief Executive Officer";

[0100] Vocabulary spelling correction, such as correcting "birth date" to "birth month and year".

[0101] Step 9: Calculate the similarity between each retrieval task and the semantic tag set, and build a similarity list. This includes:

[0102] Step 9.1: Train the similarity calculation model by minimizing the loss function using gradient descent.

[0103] The similarity calculation model is trained using gradient descent to minimize the loss function. The principle is to iteratively update the model parameters, gradually reducing the model's loss value, thereby optimizing the model's performance.

[0104] The expression for the similarity calculation model is: ,in, Indicates the retrieval task.b Represents a set of semantic tags. To retrieve the similarity between the task and the semantic tag set, i To retrieve the entity ID in the task, n To determine the number of entities in the retrieval task, j For the entity number in the semantic vector label set, m The number of entities in the semantic vector label set. To retrieve word vector representations of entities in a retrieval task, For word vector representations of entities in a semantic tag set, For the retrieval task of the first i The first entity in the semantic vector tag set j Cosine similarity between entities;

[0105] The expression for minimizing the loss function using gradient descent is: ,in, L To predict the mean squared error between the similarity score and the true similarity label, where y is the true similarity label, D This is the training dataset.

[0106] The above iterative optimization process is as follows:

[0107] (1) Initialize parameters. Randomly initialize the parameters of the similarity calculation model.

[0108] (2) Forward propagation. The similarity calculation model is used to output the similarity between the retrieval task and the semantic tag set.

[0109] (3) Calculate the loss. Calculate the loss value of the model by minimizing the loss function using the gradient descent method.

[0110] (4) Backpropagation. The gradient of the model parameters is calculated by minimizing the loss function with respect to similarity using gradient descent. This is usually done automatically by deep learning frameworks (such as TensorFlow and PyTorch).

[0111] (5) Update parameters. Update model parameters using gradient descent.

[0112] (6) Repeat (2)-(6) above until the loss value converges or the preset number of iterations is reached.

[0113] Step 9.2: Calculate the similarity between each retrieval task and the semantic tag set using the trained similarity calculation model.

[0114] Step 10: Send the similarity list of this semantic block to each of the remaining semantic blocks through the mesh network.

[0115] The purpose of this step is to prepare for distributed retrieval. Mesh networks, as a decentralized wireless networking technology, construct a seamless network through the collaborative work of multiple intelligent nodes. Mesh networks employ a mesh topology, automatically establishing optimal transmission paths between nodes. By broadcasting the similarity list of the current semantic block to every other semantic block through the mesh network, each semantic block can obtain the similarity between each retrieval task and the semantic tag set in the other semantic blocks. This allows the optimal retrieval task for the current semantic block to be determined through similarity comparison, establishing the best matching relationship between each retrieval task and each semantic block. This facilitates the use of a distributed collaborative architecture by each semantic block to complete the retrieval task.

[0116] It should be noted that before this step, a mesh communication module needs to be configured for each semantic block to establish a communication link between this semantic block and the other semantic blocks.

[0117] Step 11: Merge the similarity list of this semantic block with all received similarity lists to establish a task matching list.

[0118] Assume there are 4 semantic blocks, and the retrieval list contains 4 retrieval tasks. Within each semantic block, after similarity calculation, the similarity list established for semantic block A is shown in Table 1, the similarity list established for semantic block B is shown in Table 2, the similarity list established for semantic block C is shown in Table 3, and the similarity list established for semantic block D is shown in Table 4.

[0119]

[0120] Table 1

[0121]

[0122] Table 2

[0123]

[0124] Table 3

[0125]

[0126] Table 4

[0127] After merging all similarity lists, a task matching list is created as shown in Table 5.

[0128]

[0129] Table 5

[0130] Step 12: Query the optimal retrieval task for this semantic block from the task matching list.

[0131] Referring to Table 5, for semantic block A, after similarity calculation, it was found that it has the highest matching pair with retrieval task 4. Therefore, retrieval task 4 is selected as the optimal retrieval task for semantic block A. For semantic block B, after similarity calculation, it was found that it has the highest matching degree with retrieval task 1. Therefore, retrieval task 1 is selected as the optimal retrieval task for semantic block A. Similarly, semantic block C selects retrieval task 2 as the optimal retrieval task, and semantic block D selects retrieval task 3 as the optimal retrieval task.

[0132] By broadcasting similarity lists, establishing task matching lists, and matching optimal retrieval tasks, multiple semantic blocks can collaboratively complete the retrieval tasks in the task list. For large-scale knowledge graphs, a distributed collaborative retrieval architecture can significantly shorten retrieval time, improve retrieval efficiency, and thus increase the overall translation rate. Furthermore, employing optimal retrieval task matching strategies can also improve retrieval accuracy.

[0133] Step 13: Execute the optimal retrieval task and feed the retrieval results back to the translation model.

[0134] On the translation model side, perform steps 14 to 15.

[0135] Step 14: Translate each text segment with a second tag based on the retrieval results from each semantic block, and store the translation results in the corresponding cache space.

[0136] Step 15: Merge the translation results of all cached spaces according to the location number to obtain the final translation result.

[0137] Based on the above explanation of step 3, after storing the translation results of step 14 into the corresponding cache space, the order of all translation results is consistent with the order of the corresponding text segments in the text to be translated. The overall word order of the translated text obtained after sentence splicing is consistent with the overall word order of the text to be translated, and the final translation result is output.

[0138] Example 2: Corresponding to the method provided in Example 1, this example provides a translation optimization system for a knowledge graph-assisted semantic enhancement translation model. The organizational structure of this translation optimization system is as follows: Figure 2 As shown, it includes the following functional modules:

[0139] The data acquisition module is used to extract scanning results and retrieval lists from the semantically enhanced translation model; the scanning results contain multiple segmented text fragments, and the retrieval lists contain multiple retrieval tasks.

[0140] The tagging module is used to add a first tag or a second tag to each text fragment based on the search list; the first tag indicates that the text fragment can be directly translated, and the second tag indicates that the text fragment requires entity retrieval;

[0141] The cache allocation module is used to allocate corresponding cache space for each text segment based on its position in the text to be translated;

[0142] The first data sending module is used to send the search list to the knowledge graph side;

[0143] The first translation module is used to translate text segments with the first tag one by one and store the translation results in the corresponding cache space.

[0144] The knowledge graph partitioning module is used to divide the knowledge graph into multiple semantic blocks;

[0145] The second data sending module is used to distribute the retrieval list to each semantic block;

[0146] The tag set generation module is used to generate the semantic tag set for the semantic block;

[0147] The similarity calculation module is used to calculate the similarity between each retrieval task and the semantic tag set, and to build a similarity list;

[0148] The mesh communication module is used to send the similarity list to each of the remaining semantic blocks through the mesh network;

[0149] The first data fusion module is used to merge the similarity list of this semantic block with all received similarity lists to establish a task matching list;

[0150] The task query module is used to query the optimal retrieval task for this semantic block from the task matching list;

[0151] The task execution module is used to execute the optimal retrieval task;

[0152] The third data sending module is used to feed back the search results to the translation model.

[0153] The second translation module is used to translate each text segment with a second tag based on the retrieval results fed back by each semantic block, and store the translation results in the corresponding cache space;

[0154] The second data fusion module is used to merge the translation results of all cached spaces according to the location number to obtain the final translation result.

[0155] Furthermore, the tag adding module includes:

[0156] The keyword extraction unit is used to extract all entities from a text fragment;

[0157] The keyword matching unit is used to match each entity with each retrieval task;

[0158] The first tag addition unit is used to add a first tag to a text fragment when all entities do not exist in any retrieval task;

[0159] The second tag adding unit is used to add a second tag to a text fragment when at least one entity exists in one or more retrieval tasks.

[0160] Furthermore, the knowledge graph partitioning module includes:

[0161] The semantic genealogy tree building unit is used to build a semantic genealogy tree based on the hierarchical structure of the knowledge graph. The semantic genealogy tree contains multiple subtrees and multiple cross-class entities. Each subtree contains a parent node representing the entity type, and each parent node contains multiple child nodes representing specific entities.

[0162] Cross-class entity partitioning unit is used to partition cross-class entities into the subtree containing the parent node with the highest similarity, resulting in multiple semantic blocks.

[0163] Furthermore, the tag set generation module includes:

[0164] The semantic extraction unit is used to extract the semantics corresponding to each entity from this semantic block using named entity recognition technology, and to establish an initial semantic vector set.

[0165] The semantic tag generation unit is used to generate semantic tags for each vector in the initial semantic vector set using the word vector model, and to establish the initial semantic tag set;

[0166] The data cleaning unit is used to clean the initial semantic tag set to obtain the semantic tag set of this semantic block.

[0167] Furthermore, the similarity calculation module includes:

[0168] The model training unit is used to train the similarity calculation model by minimizing the loss function using gradient descent.

[0169] The similarity calculation unit is used to calculate the similarity between each retrieval task and the semantic tag set using the trained similarity calculation model.

[0170] It should be noted that the working principles, processes, functions and effects of the above-mentioned functional modules and units can be referred to the corresponding implementation steps in the method described in Embodiment 1 above, and will not be repeated in this embodiment.

[0171] Example 3: Based on the method provided in Example 1 and the system provided in Example 2, this example provides a computer device that executes the method described in Example 1 or any other method that may involve the method described in Example 1. The device includes a memory, a processor, and a transceiver connected in sequence. The memory stores a computer program, the transceiver sends and receives messages, and the processor reads the computer program and executes the method described in Example 1 or any other method that may involve the method described in Example 1. Specifically, the memory may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or last-in-first-out (FILO) memory, etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. Furthermore, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0172] The working process, working details and technical effects of the aforementioned computer device provided in this embodiment can be found in the method described in Embodiment 1 or any method that may involve the method described in Embodiment 1, and will not be repeated here.

[0173] Example 4: This example provides a computer-readable storage medium that stores instructions that include the method described in Example 1 or any other method that may involve the method described in Example 1. Specifically, the computer-readable storage medium stores instructions that, when executed on a computer, perform the method described in Example 1 or any other method that may involve the method described in Example 1. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0174] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in this embodiment can be found in the method described in Embodiment 1 or any method that may be related to Embodiment 1, and will not be repeated here.

[0175] Example 5: This example provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method described in Example 1 or any method that may involve the method described in Example 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0176] It should be understood that the terms "system," "device," "unit," and / or "module" as used in this specification are a method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0177] As indicated in this specification and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0178] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0179] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings are merely for illustrative purposes to aid those skilled in the art and are not intended to limit the scope of the invention. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effectiveness and purpose of the invention, should still fall within the scope of the disclosed technical content. Furthermore, terms such as "upper," "lower," "left," "right," and "middle" used in this specification are merely for clarity and not intended to limit the scope of the invention. Changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.

Claims

1. A translation optimization method for a knowledge graph-assisted semantic enhancement translation model, characterized in that, Includes the following steps: On the translation model side: Scanning results and a retrieval list are extracted from the semantically enhanced translation model. The scanning results contain multiple segmented text fragments, and the retrieval list contains multiple retrieval tasks. A first or second tag is added to each text fragment according to the retrieval list. The first tag indicates that the text fragment can be directly translated, while the second tag indicates that the text fragment requires entity retrieval. A corresponding cache space is allocated to each text fragment based on its position in the text to be translated. Text fragments with the first tag are translated one by one, and the translation results are stored in the corresponding cache space. Simultaneously, the retrieval list is sent to the knowledge graph side. Add a first or second tag to each text fragment based on the search list, including the following steps: For each text fragment: extract all entities in the text fragment; match each entity with each search task; if all entities do not exist in any search task, add a first tag to the text fragment; if at least one entity exists in one or more search tasks, add a second tag to the text fragment. On the knowledge graph side: the knowledge graph is divided into multiple semantic blocks; the retrieval list is sent to each semantic block; within each semantic block: a semantic tag set for that semantic block is generated; the similarity between each retrieval task and the semantic tag set is calculated, and a similarity list is established; a mesh communication module is configured for each semantic block; the mesh communication module is used to establish communication links between this semantic block and the other semantic blocks, forming a mesh network; the mesh network is a decentralized wireless networking technology that builds a seamless network through the collaborative work of multiple nodes. The mesh network adopts a mesh topology structure, and the optimal transmission path is automatically established between each node; the similarity list is sent to each of the other semantic blocks through the mesh network; the similarity list of this semantic block is merged with all received similarity lists to establish a task matching list; the optimal retrieval task for this semantic block is queried from the task matching list; the optimal retrieval task is executed, and the retrieval results are fed back to the translation model side; On the translation model side: each text segment with a second tag is translated based on the retrieval results fed back from each semantic block, and the translation results are stored in the corresponding cache space; the translation results of all cache spaces are merged according to the position number to obtain the final translation result.

2. The translation optimization method for a knowledge graph-assisted semantic enhancement translation model according to claim 1, characterized in that, Dividing a knowledge graph into multiple semantic blocks includes the following steps: A semantic genealogy tree is constructed based on the hierarchical structure of the knowledge graph. The semantic genealogy tree contains multiple subtrees and multiple cross-class entities. Each subtree contains a parent node representing the entity type, and each parent node contains multiple child nodes representing specific entities. Perform the following steps for each cross-class entity: The similarity between cross-class entities and each parent node is obtained through an attribute semantic similarity calculation model; Cross-class entities are divided into subtrees containing the parent node with the highest similarity, resulting in multiple semantic blocks.

3. The translation optimization method for a knowledge graph-assisted semantic enhancement translation model according to claim 1 or 2, characterized in that, Generating a semantic tag set for a semantic block includes the following steps: Named entity recognition technology is used to extract the semantics corresponding to each entity from this semantic block and establish an initial semantic vector set; Use a word vector model to generate semantic labels for each vector in the initial semantic vector set, and establish an initial semantic label set; The initial semantic tag set is cleaned to obtain the semantic tag set for this semantic block.

4. The translation optimization method for a knowledge graph-assisted semantic enhancement translation model according to claim 2, characterized in that, Calculating the similarity between each retrieval task and the semantic tag set includes the following steps: The similarity calculation model is trained by minimizing the loss function using gradient descent. The similarity between each retrieval task and the semantic tag set is calculated using the trained similarity calculation model; The expression for the similarity calculation model is: ,in, a Indicates the retrieval task. b Represents a set of semantic tags. To retrieve the similarity between the task and the semantic tag set, i To retrieve the entity ID in the task, n To determine the number of entities in the retrieval task, j For the entity number in the semantic vector label set, m The number of entities in the semantic vector label set. To retrieve word vector representations of entities in a retrieval task, For word vector representations of entities in a semantic tag set, For the retrieval task of the first i The first entity in the semantic vector tag set j Cosine similarity between entities; The expression for minimizing the loss function using gradient descent is: ,in, L To predict the mean squared error between the similarity and the true similarity label, y represents the true similarity label.

5. A translation optimization system for a knowledge graph-assisted semantic enhancement translation model, characterized in that, include: The data acquisition module is used to extract the scanning results and retrieval list from the semantically enhanced translation model; The scan results contain multiple segmented text fragments, and the search list contains multiple search tasks; The tagging module is used to add a first or second tag to each text fragment based on the search list; The first tag indicates that the text fragment can be directly translated, and the second tag indicates that the text fragment requires entity retrieval; the tag adding module includes: The keyword extraction unit is used to extract all entities from a text fragment; The keyword matching unit is used to match each entity with each retrieval task; The first tag addition unit is used to add a first tag to a text fragment when all entities do not exist in any retrieval task; The second tag adding unit is used to add a second tag to a text fragment when at least one entity exists in one or more retrieval tasks; The cache allocation module is used to allocate corresponding cache space for each text segment based on its position in the text to be translated; The first data sending module is used to send the search list to the knowledge graph side; The first translation module is used to translate text segments with the first tag one by one and store the translation results in the corresponding cache space. The knowledge graph partitioning module is used to divide the knowledge graph into multiple semantic blocks; The second data sending module is used to distribute the retrieval list to each semantic block; The tag set generation module is used to generate the semantic tag set for the semantic block; The similarity calculation module is used to calculate the similarity between each retrieval task and the semantic tag set, and to build a similarity list; The mesh communication module is used to establish communication links between the current semantic block and other semantic blocks to form a mesh network. The similarity list is sent to each other semantic block through the mesh network. The mesh network is a decentralized wireless networking technology that builds a seamless network through the collaborative work of multiple nodes. The mesh network adopts a mesh topology structure, and the optimal transmission path is automatically established between each node. The first data fusion module is used to merge the similarity list of this semantic block with all received similarity lists to establish a task matching list; The task query module is used to query the optimal retrieval task for this semantic block from the task matching list; The task execution module is used to execute the optimal retrieval task; The third data sending module is used to feed back the search results to the translation model. The second translation module is used to translate each text segment with a second tag based on the retrieval results fed back by each semantic block, and store the translation results in the corresponding cache space; The second data fusion module is used to merge the translation results of all cached spaces according to the location number to obtain the final translation result.

6. The translation optimization system for a knowledge graph-assisted semantic enhancement translation model according to claim 5, characterized in that, The knowledge graph partitioning module includes: The semantic genealogy tree building unit is used to build a semantic genealogy tree based on the hierarchical structure of the knowledge graph. The semantic genealogy tree contains multiple subtrees and multiple cross-class entities. Each subtree contains a parent node representing the entity type, and each parent node contains multiple child nodes representing specific entities. Cross-class entity partitioning unit is used to partition cross-class entities into the subtree containing the parent node with the highest similarity, resulting in multiple semantic blocks.

7. A translation optimization system for a knowledge graph-assisted semantic enhancement translation model according to claim 5 or 6, characterized in that, The tag set generation module includes: The semantic extraction unit is used to extract the semantics corresponding to each entity from this semantic block using named entity recognition technology, and to establish an initial semantic vector set. The semantic tag generation unit is used to generate semantic tags for each vector in the initial semantic vector set using the word vector model, and to establish the initial semantic tag set; The data cleaning unit is used to clean the initial semantic tag set to obtain the semantic tag set of this semantic block.

8. The translation optimization system for a knowledge graph-assisted semantic enhancement translation model according to claim 6, characterized in that, The similarity calculation module includes: The model training unit is used to train the similarity calculation model by minimizing the loss function using gradient descent. The similarity calculation unit is used to calculate the similarity between each retrieval task and the semantic tag set using the trained similarity calculation model; The expression for the similarity calculation model is: ,in, a Indicates the retrieval task. b Represents a set of semantic tags. To retrieve the similarity between the task and the semantic tag set, i To retrieve the entity ID in the task, n To determine the number of entities in the retrieval task, j For the entity number in the semantic vector label set, m The number of entities in the semantic vector label set. To retrieve word vector representations of entities in a retrieval task, For word vector representations of entities in a semantic tag set, For the retrieval task of the first i The first entity in the semantic vector tag set j Cosine similarity between entities; The expression for minimizing the loss function using gradient descent is: ,in, L To predict the mean squared error between the similarity and the true similarity label, y represents the true similarity label.

Citation Information

Patent Citations

  • Machine translation method and apparatus, and machine translation system training method and apparatus

    CN108073573A

  • Interpretable smart medical auxiliary diagnosis system based on text retrieval

    CN112687388A