Deep learning-based ancient modern text machine translation method
By constructing a closed parallel corpus of classical Chinese texts and a probability-weighted part-of-speech embedding mechanism, the problems of domain knowledge deficiency and grammatical complexity in classical Chinese translation are solved, achieving high-quality generation of classical Chinese translations and improving the accuracy and robustness of classical Chinese translation.
Patent Information
- Application Number
- CN202511600003.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-01-30
AI Technical Summary
Existing neural network models suffer from mistranslation in classical Chinese translation, struggle to handle complex grammatical correspondences, and the scarcity of parallel classical Chinese corpora limits the model's generalization ability. Furthermore, they are weak in expressing long-distance dependencies and metaphors, resulting in awkward translations or logical breaks.
We construct a closed-loop parallel corpus retrieval database of classical Chinese texts, achieve accurate domain knowledge injection through historical terminology alignment and logical chain reasoning, introduce a probability-weighted part-of-speech embedding mechanism, and adopt a fixed loss weight strategy to collaboratively optimize semantic generation, retrieval alignment and grammatical constraints, combined with multi-task collaborative training.
It significantly improves the accuracy and robustness of classical Chinese translation, reduces the translation error rate, enhances semantic understanding and logical coherence, and supports the extended application of complex classical Chinese texts.
Smart Images

Figure CN121435995A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a machine translation method for ancient and modern Chinese based on deep learning, belonging to the field of natural language processing technology. Background Technology
[0002] Classical Chinese has unique spatiotemporal encoding characteristics, including diachronic features and contextual dependence, which structurally conflict with modern language processing paradigms. While current neural network models, represented by Transformer, perform well in modern language tasks, they face many bottlenecks in classical Chinese translation: (1) Classical Chinese uses word classes frequently, such as nouns used as verbs and function words with complex functions. General models such as BERT and T5, despite performing well in many tasks, can mistranslate when dealing with complex grammatical correspondences. (2) The scarcity of parallel classical Chinese corpora limits the generalization ability of models, resulting in insufficient accuracy in translating historical terms and implicit logic. (3) Classical Chinese rhetorical devices, such as intertextuality and inversion, differ significantly from modern Chinese. Existing models are weak in their ability to interpret long-distance dependencies and metaphorical expressions across time, resulting in stiff or logically broken translations.
[0003] While Retrieval Augmentation (RAG) technology can introduce external knowledge, its open-domain retrieval mechanism is prone to semantic misalignment, making it difficult to capture the implicit logic of historical terms in classical Chinese contexts. Traditional neural machine translation models rely on implicit attention mechanisms to model grammatical correspondences, which are insufficient for explicitly modeling grammatical features such as word class usage and polysemy of function words in classical Chinese, resulting in syntactic structural misalignment. Multi-task learning frameworks fail to incorporate domain knowledge to optimize pragmatic coherence, leading to a break in the "semantic-syntactic-pragmatic" three-dimensional structure. These problems expose the shortcomings of existing models in understanding the deep structure of classical Chinese, highlighting the urgency of building domain-adaptive models. Summary of the Invention
[0004] This invention proposes a machine translation method for classical and modern Chinese based on deep learning. It consists of three parts: a retrieval enhancement generation module, a part-of-speech guidance module, and a multi-task collaborative optimization mechanism. Its core innovation lies in achieving deep understanding of classical Chinese and high-quality translation generation through the fusion of semantic expansion and part-of-speech probability weighted features.
[0005] The innovation of this invention is mainly reflected in three aspects: First, it constructs a closed-loop parallel corpus retrieval database of classical Chinese texts, achieving accurate domain knowledge injection through historical terminology alignment and logical chain reasoning. At the same time, it utilizes logical chain reasoning to enhance pragmatic coherence and solve the problem of cross-textual reasoning of implicit logic in classical allusions. Second, it introduces a probability-weighted part-of-speech embedding mechanism to dynamically integrate the grammatical feature distribution of polysemous function words, effectively mitigating the interference of annotation noise on model training. Third, it adopts a fixed loss weight strategy to collaboratively optimize semantic generation, retrieval alignment, and grammatical constraint objectives, balancing the multi-task contributions of the model, thereby comprehensively improving the accuracy and robustness of classical Chinese translation.
[0006] The specific steps of the method include: S1. Construct a closed-loop parallel corpus retrieval database of classical Chinese texts, and achieve precise injection of domain knowledge through historical terminology alignment and logical chain reasoning; S2. A probability-weighted part-of-speech embedding mechanism is used to dynamically model the flexible use of word classes and polysemy of function words in classical Chinese, and the grammatical parsing is optimized by combining noise-resistant features; S3. Based on a fixed weight strategy, the semantic generation, retrieval alignment, and part-of-speech constraint tasks are jointly optimized to achieve multi-task collaborative training; S4. Generate translations using a bundle search strategy and evaluate translation quality using BLEU and ROUGE-L metrics.
[0007] The specific implementation steps of S1 include: S11. Based on the pre-trained classical Chinese encoder, semantic encoding is performed on the source text of the training set to construct the FAISS index library; S12. Extract high-frequency term mapping rules through historical term alignment algorithm, and strengthen the implicit logical association of context by combining logical chain reasoning; S13. Retrieve Top-k similar segments from the input text and optimize the model parameters using cross-entropy loss and retrieval enhancement loss.
[0008] The specific implementation steps of S2 include: S21. Generating soft-label probability distributions based on a pre-trained classical Chinese part-of-speech tagging model; S22. Generate noise-resistant part-of-speech guided embeddings by dynamically weighting and fusing latent state features through a learnable part-of-speech embedding matrix; S23. The original encoding and part-of-speech guided embedding are concatenated and input into the decoder, and the part-of-speech distribution is aligned by constraining the cross-entropy loss.
[0009] The specific implementation steps of S3 include: S31. Set fixed weight parameters to balance the contributions of multiple tasks; S32. Gradient coordination updates are achieved through a shared encoder-decoder backbone network to avoid multi-task conflicts; S33. Combine the AdamW optimizer with gradient clipping strategy to stabilize the training process.
[0010] The specific implementation steps of S4 include: S41. Use a beam search strategy to generate the translation; S42. Calculate the BLEU and ROUGE-L indices on the test sets of the Book of Han and the New History of Tang to verify the improvement in semantic accuracy and logical coherence.
[0011] The beneficial effects of this invention are: Significantly improving the semantic accuracy and logical coherence of classical Chinese translation, this method effectively addresses the challenges of domain knowledge gaps and grammatical complexity in classical Chinese translation by integrating closed-loop retrieval enhancement generation with probability-weighted part-of-speech embedding mechanisms.
[0012] Precise domain knowledge injection and historical terminology restoration construct a closed parallel corpus of classical Chinese texts. Similar fragment retrieval with sublinear time complexity is achieved through FAISS indexing. Combined with historical terminology alignment and logical chain reasoning, the translation error rate of low-frequency words and complex sentence structures is significantly reduced.
[0013] Dynamic noise-resistant part-of-speech parsing and grammatical robustness enhancement adopt a probability-weighted part-of-speech embedding mechanism, dynamically integrates the grammatical feature distribution of function word polysemy and word class usage, and reduces annotation noise interference through a soft-label noise-resistant strategy.
[0014] Multi-task collaborative optimization and efficient resource utilization are achieved by balancing semantic generation, retrieval alignment and part-of-speech constraint tasks through a fixed weight strategy, thereby realizing gradient coordinated update of the encoder-decoder backbone network.
[0015] It supports extended applications for complex classical Chinese texts. The modular design allows for flexible expansion to low-resource classical Chinese translation tasks such as poetry and philosophy. Attached Figure Description
[0016] Figure 1 This is a flowchart from the present invention; Figure 2 This is a detailed flowchart of the present invention. Detailed Implementation
[0017] Example 1: Implementation of the Search Enhancement Generation Module This invention addresses the problem of domain knowledge gaps in classical Chinese translation by proposing a retrieval enhancement generation method based on a closed parallel corpus. It achieves similar segment retrieval with sublinear time complexity through the FAISS index. The specific steps are as follows: Step 1: Semantic Encoding and Index Building Based on pre-trained ancient Chinese encoder The training set source text Encode as dense vector And build the FAISS index library. The formula is as follows: .
[0018] Where d is the encoding dimension, FAISS achieves efficient nearest neighbor search through product quantization technology.
[0019] Furthermore, Step 1 includes: Step 1.1: Using a pre-trained encoder Encode the source text of the training set; Step 1.2: Construct the FAISS index library, including index dimensions and encoding dimensions. Consistent; Step 1.3: Store the encoded vector The index supports sublinear time retrieval.
[0020] Step 2: Similarity retrieval and joint training For input text encoding Top-k similar segments were retrieved using Euclidean distance. The formula is as follows: Search results With the original input A common input encoder-decoder architecture is used to jointly optimize the loss of the main task. With retrieval enhancement loss The formula is as follows: in, T The length of the target sequence. It is a location t The true label distribution; Is the model in position? t The predicted probability distribution.
[0021] in For similar text Corresponding translation Length; It is the probability distribution of the target word predicted by the model.
[0022] Example 2: Implementation of the Part-of-Speech Guidance Module To address the issues of word class flexibility and polysemy of function words in classical Chinese, a probability-weighted part-of-speech embedding mechanism is designed to dynamically integrate grammatical features. The specific steps are as follows: Step 1: Part-of-speech probability modeling is based on a pre-trained classical Chinese part-of-speech tagging model to generate word symbols. The probability distribution of 14 types of parts of speech.
[0023] Step 2: Dynamic part-of-speech embedding fusion to extract the encoder's hidden state Mapping to the part-of-speech space generates a probability distribution. And the learnable part-of-speech embedding matrix is fused by probability weighting. The formula is as follows: Step 3: Noise-resistant feature splicing combines the original encoding With part-of-speech guided embedding After concatenation, input the data into the decoder using the following formula: Constraining part-of-speech distribution alignment using cross-entropy loss: in, T Given the length of the input sequence, i There are 14 types of part-of-speech tags; Provided by a pre-trained classical Chinese part-of-speech tagging model, representing word symbols. The true part-of-speech distribution; This is the predicted distribution generated by FFN in PGM.
[0024] Example 3: Multi-task collaborative optimization is implemented by jointly optimizing semantic generation, retrieval alignment, and part-of-speech tagging tasks using a fixed-weight strategy. The total loss function is as follows: in =1.0, =0.8, 0.1.
[0025] Furthermore, the optimization steps include: Step 3.1: Share encoder-decoder backbone network parameters and update gradients using the AdamW optimizer; Step 3.2: Employ a gradient pruning strategy to prevent training oscillations caused by multi-task conflicts; Step 3.3: After each training round, adjust the learning rate on the validation set.
[0026] To demonstrate the effectiveness of the proposed method, experiments were conducted on the Han Shu and Xin Tang Shu. In the experiments, BLUE and ROUGE were used as evaluation metrics to accurately assess the method's performance; these two metrics can objectively and accurately reflect the effectiveness of machine translation.
[0027] The method of this invention improved the BLEU scores of the corresponding model in the Book of Han and the New Book of Tang by 1.45 and 1.46 respectively, and the ROUGE-L scores by 1.05 and 1.97, respectively, which verified the synergistic advantages of retrieval enhancement and part-of-speech guidance.
Claims
1. A method for ancient and modern Chinese machine translation based on deep learning, characterized in that, The application relates to a method for improving the accuracy of ancient Chinese text translation, which comprises the following steps: (1) Retrieval enhancement generation module: based on a closed ancient Chinese parallel corpus, a FAISS index is constructed, Top-k similar fragments of the input text are retrieved through sub-linear time complexity, and the model is optimized by combining the main task loss and the retrieval enhancement generation loss; (2) Part-of-speech guidance module: a pre-trained ancient Chinese part-of-speech tagging model is used to generate soft labels, part-of-speech features are dynamically fused through probability weighted part-of-speech embedding, and the part-of-speech distribution alignment is constrained by combining the cross-entropy loss; (3) Multi-task collaborative optimization module: the semantic generation, retrieval alignment and part-of-speech constraint tasks are jointly optimized through a fixed weight strategy, and the gradient of the encoder-decoder backbone network is coordinated and updated.
2. A deep learning-based ancient and modern Chinese machine translation method, characterized in that, The method comprises the following steps: S1. A closed ancient Chinese parallel corpus is constructed, and domain knowledge is injected through historical term alignment and logical chain reasoning; S2. The ancient Chinese word class and polysemy of virtual words are dynamically modeled through a probability weighted part-of-speech embedding mechanism; S3. The semantic generation, retrieval enhancement generation and part-of-speech constraint tasks are jointly optimized, and the multi-task contribution is balanced through a fixed weight strategy; S4. The translation is generated based on a beam search strategy, and the translation quality is evaluated by the BLEU and ROUGE-L indexes.
3. The method of claim 2, wherein, The specific implementation steps of S1 comprise: S11. The training set source text is encoded based on a pre-trained ancient Chinese encoder, and a FAISS index library is constructed; S12. Term mapping rules are extracted through a historical term alignment algorithm, and the context implicit logical association is strengthened by combining logical chain reasoning; S13. Top-k similar fragments of the input text are retrieved, and the model parameters are optimized by combining the cross-entropy loss and the retrieval enhancement loss.
4. The method of claim 2, wherein, The specific implementation steps of S2 comprise: S21. The part-of-speech probability distribution is generated based on a pre-trained ancient Chinese part-of-speech tagging model based on the RoBERTa architecture; S22. The noise-resistant part-of-speech guidance embedding is generated by dynamically weighting and fusing the hidden state features through a learnable part-of-speech embedding matrix; S23. The original encoding and the part-of-speech guidance embedding are spliced and input into the decoder, and the part-of-speech distribution alignment is constrained by the cross-entropy loss.
5. The method of claim 2, wherein, The specific implementation steps of S3 comprise: S31. A fixed weight parameter is set to balance the multi-task contribution; S32. The encoder-decoder backbone network parameters are shared, and the gradient clipping strategy is adopted to avoid multi-task conflicts; S33. The AdamW optimizer and the learning rate decay strategy are adopted to stabilize the training process.
6. The method of claim 2, wherein, The specific implementation steps of S4 comprise: S41. The translation is generated by adopting a beam search strategy; S42. The BLEU and ROUGE-L indexes are calculated on the test sets of the Han Shu and the Xin Tang Shu, and the improvement of the semantic accuracy and the logical coherence is verified.