A cross-border logistics single multi-language machine translation method based on natural language processing
By employing a multilingual machine translation method for cross-border logistics documents based on natural language processing, combined with OCR technology, cross-language aligned translation models, and knowledge graphs, professional translation and automated compliance review of cross-border logistics documents have been achieved. This has solved the problems of translation accuracy and compliance, and improved the intelligence level of cross-border logistics document processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO UNIV OF TECH
- Filing Date
- 2025-11-19
- Publication Date
- 2026-07-21
AI Technical Summary
In cross-border e-commerce and international logistics, existing technologies for machine translation lack industry adaptability, have insufficient translation accuracy, and rely on manual compliance review, resulting in low efficiency and a high risk of errors. They are also unable to cope with changes in international regulations and large-scale business expansion.
It employs a natural language processing approach, extracts document text using OCR technology, performs professional translation using a cross-language aligned translation model, and combines knowledge graphs and dual verification algorithms for automated compliance review, generating translation results and compliance review reports, and supporting manual review and revision.
It improved translation accuracy by 15%-20%, achieved a compliance risk recall rate of over 90%, reduced the burden of manual review, supported multilingual adaptation, and reduced customs clearance delays and economic losses caused by document errors.
Smart Images

Figure CN121525709B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine translation technology, and in particular to a multilingual machine translation method for cross-border logistics documents based on natural language processing. Background Technology
[0002] With the rapid development of global trade, cross-border e-commerce and international logistics companies need to handle a large number of documents involving different countries, languages, and regulatory requirements, such as commercial invoices, packing lists, bills of lading, customs declarations, and certificates of origin. These documents typically have the following characteristics: 1. High linguistic diversity: Common languages include English, Chinese, Spanish, German, Arabic, etc., resulting in complex translation needs.
[0003] 2. High level of expertise required: It involves specialized knowledge such as HS Code, dangerous goods declaration, import and export regulations, and trade terms.
[0004] 3. Significant compliance risks: Human translation or review may result in omissions or misjudgments, which could lead to customs clearance delays, fines, or even legal disputes.
[0005] Current technologies largely rely on general machine translation (such as Google Translate) and human compliance review, which presents the following problems in large-scale, multilingual, and multi-scenario applications: General translation lacks industry-specific adaptability, suffers from inconsistent terminology, and is insufficient in accuracy. Compliance audits rely on manual processes, which are inefficient and prone to errors. It is difficult to respond quickly to changes in international regulations and large-scale business expansion.
[0006] Therefore, there is an urgent need for a new system that combines intelligent translation, industry knowledge base, and compliance review to improve the level of intelligence in cross-border logistics document processing. Summary of the Invention
[0007] This invention provides a multilingual machine translation method for cross-border logistics documents based on natural language processing, comprising: Step 1: Collect the original data of cross-border logistics documents and perform text extraction and preprocessing using OCR technology; Step 2: Perform language recognition and layout parsing on the pre-processed document text to determine the source language and target language; Step 3: Use a pre-trained cross-language alignment translation model to translate the document text into the target language text; Step 4: Input the translation results into the compliance review module and use knowledge graphs and dual verification algorithms for automated compliance review; Step 5: Generate output including translation results and compliance audit report, supporting manual review and revision.
[0008] The multilingual machine translation method for cross-border logistics documents based on natural language processing, as described above, involves collecting the original data of cross-border logistics documents and performing text extraction and preprocessing using OCR technology. Specifically, it consists of the following sub-steps: Receive documents from different business systems through a standardized API interface; For image files, an OCR pipeline is executed to extract the original text; The extracted raw text is organized into a structured JSON object.
[0009] The multilingual machine translation method for cross-border logistics documents based on natural language processing, as described above, includes the following sub-steps in its construction and training process for the cross-language aligned translation model: Based on the extracted structured information, prior knowledge is retrieved from the knowledge graph and standard terminology database; A dual-channel encoder is used to encode the source language text and prior knowledge; The code output from the dual-channel encoder is fused and decoded using a compliance alignment decoder to generate the target language text. We introduce terminology and regulatory semantic alignment loss into the total loss function, and iterate the model by minimizing the total loss until the model converges.
[0010] The multilingual machine translation method for cross-border logistics documents based on natural language processing, as described above, utilizes knowledge graphs and dual-verification algorithms for automated compliance review, specifically comprising the following sub-steps: Extract business fields from the translated text and match them precisely with the rule expressions retrieved from the knowledge graph; For legal provisions that are not bound to rule expressions, perform fuzzy matching between business fields and historical sample texts; The final compliance decision is generated by combining the verification results of exact matching and fuzzy matching.
[0011] As described above, the cross-border logistics document multilingual machine translation method based on natural language processing uses manually reviewed and final revised document results as high-quality training samples for online optimization of the cross-language alignment translation model, enabling continuous self-improvement of the model. The optimization process is as follows: Construct an online learning queue based on the corrected data; Based on the total loss function during the training phase, an online learning loss function is designed for the model; Every preset learning cycle, the existing model is fine-tuned using samples from the learning queue; Synchronously update the prerequisite knowledge in the standard terminology database and knowledge graph.
[0012] The beneficial effects achieved by this invention are as follows: 1. Professional translation: Based on a logistics industry corpus, the translation accuracy is improved by 15%-20%; 2. Automated review: The compliance risk recall rate exceeds 90%, reducing the burden of manual review; 3. Multilingual adaptation: Supports more than 10 mainstream languages, meeting the globalization needs of cross-border e-commerce and logistics companies; 4. Reduced compliance risks: Effectively reduces customs clearance delays and economic losses caused by document errors. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0014] Figure 1 This is a flowchart of a multilingual machine translation method for cross-border logistics documents based on natural language processing, provided in Embodiment 1 of this application. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Example 1 like Figure 1 As shown, Embodiment 1 of this application provides a multilingual machine translation method for cross-border logistics documents based on natural language processing, including: Step S10: Collect the original data of cross-border logistics documents and perform text extraction and preprocessing using OCR technology; This step aims to convert raw documents of various formats into structured text data that can be processed by subsequent modules. The specific implementation process is as follows: Step S11: Receive document files from different business systems through a standardized API interface; For received non-image format files (PDF, Word), existing libraries such as python-docx and PDFBox are used to directly parse and extract their plain text and metadata.
[0017] Step S12: For image files, perform OCR pipeline to extract the original text; For image files, the following OCR pipeline is executed: grayscale and binarization are performed using the OpenCV library to eliminate noise and background interference; image tilt is detected and corrected using Connected Component Analysis or a deep learning model; key field regions are located using object detection models such as YOLO or U-Net based on predefined document template libraries (such as fixed formats for commercial invoices, packing lists, and bills of lading); high-performance OCR engines such as PaddleOCR, Tesseract 5.0+, or Google CloudVision API are called to perform OCR recognition on the located regions individually and extract their original text data.
[0018] Step S13: Organize the extracted raw text into a structured JSON object; Using predefined regular expression rules and a named entity recognition model, structured fields are extracted from continuous text, ultimately generating a structured JSON object. This object contains the original file path, all identified text, and the extracted business field-value pairs. Data extracted from non-image format files is also formatted into a JSON object using the same method.
[0019] Step S20: Perform language recognition and layout parsing on the preprocessed document text to determine the source language and target language; The source language of the document text is identified by calling a pre-trained language recognition model, while the target language is automatically mapped to the official language of the country / region based on the destination port / delivery address field stored in the preset table. Of course, it can also be specified by the user.
[0020] Step S30: Use a pre-trained cross-language alignment translation model to translate the document text into the target language text; The cross-language aligned translation model consists of three core components: a text encoder, a Transformer-based encoder used to understand the semantics of the source language text; a knowledge encoder, a graph neural network (GNN)-based encoder used to encode relevant regulatory knowledge retrieved from a knowledge graph; and a compliance aligned decoder, which, based on the standard decoder, adds a compliance-aware cross-attention mechanism and a terminology consistency constraint module. Its specific construction and training process is divided into the following sub-steps: Step S31: Based on the extracted structured information, retrieve prior knowledge from the knowledge graph and standard terminology database; Before translation begins, relevant legal provisions of the target country are retrieved from a knowledge graph based on structured information such as HS codes, product names, document types, and product categories. Then, a pre-trained language model is used to translate each legal provision. Encode as a vector This constitutes a legal knowledge matrix. .
[0021] Then, based on the business fields in the JSON object, the mapping relationship between the source language term and the target language term is retrieved from the standard term library and constructed as a mapping table M. That is, for each source language term x, it is mapped to a standard term M(x) of the target language.
[0022] The prior knowledge retrieved above is an important basis for ensuring professional and compliant translation.
[0023] The legal provisions stored in the knowledge graph are structured knowledge units, mainly including: mandatory expression rules (i.e., standardized writing templates or phrases for the target country's customs to describe specific commodities, dangerous goods declarations, country of origin markings, etc., for example, for Class 8 corrosive liquids, the parenthetical explanation "(CORROSIVE)" must be added after the product name), prohibited or warning vocabulary (i.e., specific words prohibited or required by the laws of the target country to be used in documents), and logical constraint rules (i.e., logical relationships between different fields, for example, the declared value must match the currency type field and cannot be 0). In the knowledge graph, these provisions are represented as nodes and connected to specific HS codes, commodity categories, destination countries, etc., through relationships (such as applicable to, bound to).
[0024] The standard terminology database stores unique, official, and standardized translations of all key business entities in cross-border logistics documents in various supported languages.
[0025] Step S32: Encode the source language text and prior knowledge using a dual-channel encoder; Source language word sequence Input text encoder to obtain context representation ,in Each word in the source language text is represented separately; the legal knowledge matrix is used to represent each word. The input is a knowledge encoder, which simulates the relationships between legal entries through a shallow graph attention network, and the output is an enhanced representation of legal knowledge. .
[0026] Step S33: Use a compliance alignment decoder to fuse and decode the encoding output of the dual-channel encoder to generate the target language text; For each source language word Traditional standard decoders generate target words At that time, the cross-attention method used only calculates the source text representation. The impact on the current word of a new word, i.e., the text context vector. This invention adds a parallel regulatory cross-attention head for calculating the current decoding state. Representation of legal knowledge The relevance is used to obtain the regulatory context vector. To strengthen the binding force of key regulations, a regulatory priority weight must also be introduced in the calculation. This weight is dynamically calculated based on the frequency with which the regulatory provision has been triggered in historical compliance cases; the specific regulatory context vector The calculation formula is expressed as follows:
[0027] in, Representing legal knowledge respectively The i-th and j-th legal provision vectors in the text, Let i and j represent the priority weights of the i-th and j-th legal provisions, respectively. i and j take values from 1 to n, where n is the total number of legal provisions retrieved from the knowledge graph, and S() is the dot product function.
[0028] At each step of the decoder, the currently generated decoding state is... Text context vectors and regulatory context vectors The states are fused (by concatenating them and then passing them through a feedforward neural network) to form a knowledge-enhanced decoder state; this enhanced state is fed into the output layer to calculate the probability P(w) of each word w in the target language vocabulary V.
[0029] Step S34: Introduce the terminology and regulatory semantic alignment loss into the total loss function, and iterate the model by minimizing the total loss until the model converges; The adjusted total loss function is expressed as follows: ,in To mitigate the loss of semantic accuracy, measures are taken to ensure the fluency and overall semantic accuracy of the translation. The terminology loss is used to force the model to use the standard translation from the standard terminology library when translating specific terms. This refers to the semantic alignment loss of regulations, used to bridge the semantic gap between compliant translations and regulatory provisions through contrastive learning. For adjustable weight parameters, specifically, Where X is the source language input sequence, Y represents the true sequence of the target language. Let be the t-th word in the target sequence, where t takes values from 1 to T, and T is the length of the target sequence. This represents all words in the target sequence between the t-th word and the t-th word. Indicates that given the original text X and the preceding text Under these conditions, the model predicts the next word to be a true word. The probability of; ,in It is the model output. It is a mapping table built from a standard terminology database. It is its domain (the set of source language terms). For the source language input sequence X, the sequence belongs to A term, The total number of words in the target language vocabulary. For the k-th word in the target language vocabulary V, For indicator functions, when Returns 1 if the target translation of term 's' is true (i.e., the standard target translation of term 's'), otherwise returns 0. The generation position of term s in the target sequence is determined by the source language-target language attention weight matrix. Indicates that in the generation of the target sequence to Decoder state at position, Indicates that in the generation of the target sequence to The context vector at location (including textual context and regulatory context). This indicates that, given the decoding state and context vector, the model predicts the next word as... The probability of; ,in The semantic representation of the entire target sentence generated by the model is obtained by average pooling the final hidden state of the decoder. A semantic representation of the correct legal provisions that are positively relevant to the current translation (positive sample). The semantic representations (negative samples) of legal provisions unrelated to the current translation are sampled from the negative sample set R. The cosine similarity function is used. This is an adjustable smoothing parameter.
[0030] The specific training iteration process is as follows: Input the source language sequence X into the model to obtain the probability distribution of the model output; Calculate total loss ; Calculate total loss The gradient with respect to the current model parameters; Repeat the above steps, iterating through the training dataset multiple times, until the total loss is reached. It converges on the validation set and no longer decreases significantly.
[0031] Step S40: Input the translation results into the compliance review module and use knowledge graph and dual verification algorithm for automated compliance review; The dual-verification algorithm combines precise matching and fuzzy matching: In the knowledge graph, simple legal provisions are bound to regular expressions for verifying the compliance of related business fields. Therefore, the bound expressions can be used for precise matching of corresponding fields in the translated text. For complex provisions without bound regular expressions, fuzzy matching is used for verification. The automated compliance review based on the dual-verification algorithm consists of the following sub-steps: Step S41: Extract the business fields from the translated text and perform an exact match between them and the rule expressions retrieved from the knowledge graph; In exact matching mode, if the business fields of the translated text conform to the corresponding rules, the verification is considered successful; otherwise, it is considered unsuccessful. After all verifications are completed, a compliance score is calculated for each text segment to reflect the compliance of the current segment. This compliance score is applied to fuzzy matching because the accuracy of fuzzy matching results is unreliable, so this score is used to dynamically correct the matching results. The compliance score for any segment... The calculation formula is expressed as follows: Where i is the index of the legal provision, with a value of 1~ , The number of legal provisions related to the current paragraph. The importance weight of the i-th legal provision, For translating the sequence of business fields in the current paragraph of the text, For the i-th legal provision, For indicator functions, if for If the validation passes, return 1; otherwise, return 0.
[0032] Step S42: For legal provisions that are not bound to rule expressions, perform fuzzy matching between business fields and historical sample texts; The system retrieves logistics orders of the same type as the current document from a known compliant historical document database, extracts fields associated with unbound regulatory provisions, and then substitutes each field to be verified in the translated text, along with the extracted identical historical fields, into the fuzzy scoring formula. In the process, fuzzy scores for each field are obtained. ,in The correction factor is adjustable. This indicates the compliance score of the paragraph containing the field currently being validated. For adjustable smoothing parameters, For the current field to be validated, Indicates the first The same historical field Values range from 1 to , This represents the total number of historically identical fields retrieved. The semantic encoding function uses a pre-trained Sentence-BERT model.
[0033] In fuzzy matching mode, if the fuzzy score of the business field is higher than the preset threshold, the verification is considered to pass; otherwise, the verification is considered to fail.
[0034] Step S43: Combine the verification results of exact matching and fuzzy matching to generate the final compliance decision; The system iterates through the validation results of each business field in the translated text under two modes. If a field passes validation under either mode, the translation is considered compliant. If a field fails validation under both modes, the translation is considered non-compliant.
[0035] Step S50: Generate output including translation results and compliance audit report, supporting manual review and revision; Business fields deemed non-compliant in translation will be highlighted in the translated text, along with the corresponding legal provisions they violate. Once the highlighting is complete, the output will be generated, and the results will support manual review and revision.
[0036] The document results, after manual review and final revision, will serve as high-quality training samples for the online optimization of the cross-language alignment translation model, enabling continuous self-improvement of the model. The optimization process is as follows: Step S51: Construct an online learning queue based on the corrected data; Source language text X, model translated text and the revised translation text The data are constructed as triples and stored in a dedicated online learning queue.
[0037] Step S52: Based on the total loss function during the training phase, design an online learning loss function for the model; The total loss function in the online optimization phase is defined as: ,in and The definition is the same as that of the training phase. It corrects the guided loss, the purpose of which is to improve the model output. To be corrected manually One specific way to achieve this is through computation. and KL divergence on the model output distribution It refers to the term loss weight. It is a weighting coefficient that decays over time.
[0038] Step S53: Fine-tune the existing model using samples from the learning queue every preset learning cycle; The model is updated every preset learning period (e.g., 24 hours). The update process uses samples from the online learning queue and minimizes... To fine-tune the existing model parameters; to prevent catastrophic forgetting, a certain proportion of the original training samples must be sampled and mixed with the samples in the learning queue during the update, so that they can participate in the training together.
[0039] Step S54: Synchronously update the prior knowledge in the standard terminology base and knowledge graph; If new, standard terminology translations appear during manual revisions and their frequency exceeds a threshold, the system will prompt the administrator to add them to the standard terminology library. If it is found that a certain type of revision is always related to specific legal provisions, the system can suggest that the administrator add or optimize the regular expression rules bound to that provision to improve the coverage of subsequent exact match pattern validation.
[0040] Corresponding to the above embodiments, the present invention provides a computer storage medium, including: at least one memory and at least one processor; The memory is used to store one or more program instructions; A processor is used to run one or more program instructions to execute a multilingual machine translation method for cross-border logistics documents based on natural language processing.
[0041] Corresponding to the above embodiments, this embodiment of the invention provides a computer-readable storage medium containing one or more program instructions, which are executed by a processor to provide a multilingual machine translation method for cross-border logistics documents based on natural language processing.
[0042] The embodiments disclosed in this invention provide a computer-readable storage medium storing computer program instructions. When the computer program instructions are executed on a computer, the computer performs the aforementioned multilingual machine translation method for cross-border logistics documents based on natural language processing.
[0043] In this embodiment of the invention, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0044] The various methods, steps, and logic diagrams disclosed in the embodiments of this invention can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor reads information from the storage medium and, in conjunction with its hardware, completes the steps of the above methods.
[0045] The storage medium can be memory, such as volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0046] Among them, non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.
[0047] Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).
[0048] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0049] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using a combination of hardware and software. When applied as software, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0050] 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 on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A multilingual machine translation method for cross-border logistics documents based on natural language processing, characterized in that, include: Step 1: Collect the original data of cross-border logistics documents and perform text extraction and preprocessing using OCR technology; Step 2: Perform language recognition and layout parsing on the pre-processed document text to determine the source language and target language; Step 3: Use a pre-trained cross-language alignment translation model to translate the document text into the target language text; The cross-language aligned translation model consists of three core components: a text encoder, a Transformer-based encoder, used to understand the semantics of the source language text; and a knowledge encoder, a graph neural network-based encoder, used to encode relevant legal knowledge retrieved from a knowledge graph. The compliance alignment decoder adds a compliance-aware cross-attention mechanism and a terminology consistency constraint module to the standard decoder. The specific construction and training process of the cross-language aligned translation model consists of the following sub-steps: Based on the extracted structured information, prior knowledge is retrieved from the knowledge graph and standard terminology database; A dual-channel encoder is used to encode the source language text and prior knowledge; The code output from the dual-channel encoder is fused and decoded using a compliance alignment decoder to generate the target language text. We introduce terminology and regulatory semantic alignment loss into the total loss function, and iterate the model by minimizing the total loss until the model converges. Step 4: Input the translation results into the compliance review module and use knowledge graphs and dual verification algorithms for automated compliance review; Step 5: Generate output including translation results and compliance audit report, supporting manual review and revision.
2. The multilingual machine translation method for cross-border logistics documents based on natural language processing according to claim 1, characterized in that, The process of collecting raw data from cross-border logistics documents and performing text extraction and preprocessing using OCR technology involves the following sub-steps: Receive documents from different business systems through a standardized API interface; For image files, an OCR pipeline is executed to extract the original text; The extracted raw text is organized into a structured JSON object.
3. The multilingual machine translation method for cross-border logistics documents based on natural language processing according to claim 1, characterized in that, The legal provisions stored in the knowledge graph are specific knowledge units that have undergone structured processing, including: mandatory expression rules, prohibitive or warning vocabulary, and logical constraint rules; in the knowledge graph, these provisions are represented as nodes and connected to specific entity nodes through relationships.
4. The multilingual machine translation method for cross-border logistics documents based on natural language processing according to claim 1, characterized in that, The standard terminology database stores unique, official, and standardized translations of all key business entities in cross-border logistics documents in various supported languages.
5. The multilingual machine translation method for cross-border logistics documents based on natural language processing according to claim 1, characterized in that, The automated compliance audit using knowledge graphs and dual-verification algorithms consists of the following sub-steps: Extract business fields from the translated text and match them precisely with the rule expressions retrieved from the knowledge graph; For legal provisions that are not bound to rule expressions, perform fuzzy matching between business fields and historical sample texts; The final compliance decision is generated by combining the verification results of exact matching and fuzzy matching.
6. The multilingual machine translation method for cross-border logistics documents based on natural language processing according to claim 1, characterized in that, The document results, after manual review and final revision, will serve as high-quality training samples for online optimization of the cross-language alignment translation model, enabling continuous self-improvement of the model. The optimization process is as follows: Construct an online learning queue based on the corrected data; Based on the total loss function during the training phase, an online learning loss function is designed for the model; Every preset learning cycle, the existing model is fine-tuned using samples from the learning queue; Synchronously update the prerequisite knowledge in the standard terminology database and knowledge graph.
7. A computer storage medium, characterized in that, include: At least one memory and at least one processor; Memory, used to store one or more program instructions; A processor for running one or more program instructions to perform a multilingual machine translation method for cross-border logistics documents based on natural language processing as described in any one of claims 1-6.