Intelligent ancient Chinese translation method and system based on domain adaptive retrieval enhancement
By constructing a domain-adaptive retrieval-enhanced classical Chinese translation system, the problems of domain adaptation, multi-granular semantic alignment, and allusion tracing in classical Chinese translation are solved, achieving high-quality, interpretable translation results and improving the accuracy and transparency of classical Chinese translation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN UNVERSITY OF ARTS & SCI
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-07
AI Technical Summary
Existing methods for translating classical Chinese have significant shortcomings in terms of domain adaptation, multi-granularity semantic alignment, allusion detection and tracing, and translation interpretability, resulting in low translation quality and credibility.
We construct a domain centroid vector set, a multi-granularity semantic alignment knowledge base, and a global parallel corpus vector index. We combine the bge-large-zh-v1.5 pre-trained semantic vector model for semantic encoding, perform dual-source fusion retrieval and multi-granularity semantic matching, generate domain-adaptive structured translation prompts, and provide an interpretable translation evidence chain.
It enhances the domain adaptability, professional accuracy, and cultural connotation preservation of classical Chinese translation, provides a transparent chain of translation evidence, and meets the needs of academic research and education.
Smart Images

Figure CN122154713B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ancient Chinese translation, and in particular to an intelligent ancient Chinese translation method and system based on domain adaptation retrieval enhancement. Background Art
[0002] Classical Chinese, as the core written language carrier accumulated over thousands of years of history, has carried a vast knowledge system ranging from the pre-Qin philosophers to the academic thoughts of the Ming and Qing dynasties. Its content widely covers many fields such as military strategy, philosophical speculation, historical narrative, medical theory, etc. Accurately translating classical Chinese into modern Chinese is of great practical significance for the inheritance of excellent traditional culture, academic research in related fields of classical Chinese, and the education and popularization of classical Chinese knowledge, and thus has become an important research direction that has been continuously concerned in the field of natural language processing. In recent years, the rapid evolution of deep learning technology has promoted remarkable progress in the technical foundation of classical Chinese translation, laying a solid foundation of tools and resources for further breaking through the bottleneck of classical Chinese translation quality.
[0003] At the language model level, large language models represented by the GPT series and the Qwen (Tongyi Qianwen) series have demonstrated powerful natural language understanding and generation capabilities. Such models have learned rich language knowledge and world knowledge through pre-training on large-scale multilingual corpora and perform excellently in various natural language processing tasks such as translation. Among them, the Qwen series models have been deeply optimized for Chinese corpora and have a certain basic understanding and translation ability for classical Chinese texts. However, all the knowledge of large language models is encoded in the model parameters and belongs to parameterized implicit knowledge. When facing rare allusions, technical terms, and rare expressions that are not covered enough in the training data, they are prone to hallucinations or produce inaccurate translation results.
[0004] At the retrieval-augmented generation technology level, retrieval-augmented generation (RAG), as a technical paradigm that combines an external knowledge base with a large language model, has been widely applied in knowledge-intensive tasks. The core idea of this technology is to retrieve reference information related to the input from an external knowledge base before content generation and inject the retrieval result as context into the input prompt of the large language model to provide additional knowledge support for the model. In the translation scenario, the RAG technology usually retrieves source language-target language sentence pairs that are semantically similar to the input text from a parallel corpus as translation reference examples, which to a certain extent compensates for the deficiencies of the parameterized knowledge of large language models and can assist the model in referring to high-quality existing translations to improve the accuracy and fluency of translation output.
[0005] At the semantic encoding and vector retrieval level, pre-trained semantic vector models are the core component of the RAG system. Their core function is to encode text into high-dimensional dense vectors, ensuring that semantically similar texts maintain close proximity in the vector space. Chinese semantic encoding technology, represented by the BGE (BAAI General Embedding) series models released by the Beijing Academy of Artificial Intelligence, has reached a high level of maturity. Among them, the bge-large-zh-v1.5 model performs exceptionally well in Chinese semantic similarity calculation and retrieval tasks, effectively capturing the semantic features of Classical Chinese texts. In terms of vector storage and retrieval, lightweight vector databases such as ChromaDB provide efficient vector indexing and near-nearest neighbor search capabilities, supporting millisecond-level semantic retrieval on large-scale corpora. The mature application of these semantic encoding and vector retrieval tools provides a reliable technical foundation for building an efficient Classical Chinese translation and retrieval system.
[0006] At the corpus resource level, academia and cultural digitization projects have accumulated a considerable amount of parallel bilingual corpora in Classical and Modern Chinese. These corpora cover military classics such as *The Art of War* and *The Hundred Strategies for War*, philosophical works such as *The Analects* and *Zhuangzi*, historical documents such as *Records of the Grand Historian* and *Zuo Zhuan*, and medical classics such as *The Yellow Emperor's Inner Classic*, providing a valuable data foundation for the research and systematic development of Classical Chinese translation. Furthermore, Chinese word segmentation tools such as jieba can accurately segment words in Modern Chinese texts, while automatic evaluation indicators such as sacrebleu, BERTScore, and ROUGE provide multi-dimensional measurement methods for the objective quantitative evaluation of translation quality.
[0007] Based on the above-mentioned technological foundation, the current field of classical Chinese translation has formed two mainstream technical paths: pure model-driven and retrieval-assisted generation. Both provide feasible technical solutions for classical Chinese translation, but they also have obvious technical limitations.
[0008] The first technical approach is the direct large language model translation method. The core idea of this method is to directly input the original classical Chinese text into a large language model, which then generates the corresponding modern Chinese translation end-to-end based on the parameterized knowledge learned during pre-training. In practice, input prompts typically include brief task instructions such as "Please translate the following classical Chinese text into modern Chinese," guiding the model to output the result in translation mode. The advantages of this method are its simplicity, ease of deployment, and lack of need to build and maintain an external knowledge base. Furthermore, relying on the excellent natural language generation capabilities of the large language model, the translation results generally exhibit high fluency and language quality. However, this method's knowledge source entirely depends on the training knowledge encoded in the model parameters, belonging to a closed generation paradigm. When the input text involves domain terms, obscure allusions, or rare linguistic phenomena that are not adequately covered in the model's training data, the model, lacking external evidence, can only rely on incomplete or even erroneous internal knowledge for inference, easily producing illusionary translations that appear fluent but are actually distorted. Simultaneously, since the translation process is entirely completed within the model, users cannot know the basis for the translation decisions, making it difficult to verify the credibility of the translation results.
[0009] The second technical approach is the standard retrieval-enhanced generation method. This method introduces an external knowledge retrieval step on top of the large language model translation, forming a two-stage pipeline architecture of "retrieval first, generation later." In the retrieval stage, the system first encodes the input classical Chinese text into semantic vectors using pre-trained semantic vector models such as bge-large-zh-v1.5. Then, it performs an approximate nearest neighbor search in a pre-constructed classical Chinese-modern Chinese parallel corpus vector index to retrieve several pairs of classical Chinese-modern Chinese sentence pairs that are semantically most similar to the input text as reference examples. In the generation stage, the system organizes the retrieved reference sentence pairs and the input classical Chinese text together into structured translation prompts, which are then fed into the large language model. The model then generates the final translation result by referencing high-quality existing translations. Compared to direct large language model translation methods, the standard RAG method, by introducing examples from external parallel corpora, provides the model with specific translation examples and terminology usage demonstrations, mitigating the limitations of purely parametric knowledge to some extent, especially in improving the consistency of translation style and the accuracy of common terms. This method has been validated in various knowledge-intensive natural language processing tasks and is gradually becoming the mainstream baseline scheme in current research on the translation of classical Chinese.
[0010] However, while the two mainstream technical approaches mentioned above each have their advantages, they both reveal systemic deficiencies when faced with the unique technical challenges of classical Chinese translation, such as domain-specific terminology differences, implicit allusion identification, and word-level semantic mapping. More refined and targeted technical solutions are urgently needed to overcome these challenges.
[0011] Specifically, when applied to classical Chinese translation tasks, both the direct large language model translation method and the standard retrieval-enhanced generation method exhibit significant deficiencies in four key dimensions: domain adaptation capability, multi-granular semantic understanding capability, allusion identification and tracing capability, and interpretability of the translation process. These issues collectively constrain the current upper limit of classical Chinese translation quality.
[0012] First, existing methods generally lack domain-adaptive capabilities. Classical Chinese literature spans highly heterogeneous disciplines such as military affairs, philosophy, history, and medicine. These different fields have fundamental differences in terminology, expression paradigms, and knowledge structures. For example, "fortifying the walls and clearing the fields" and "deep trenches and high ramparts" in military literature describe defensive strategic deployments, while "exhaling qi from the upper burner" and "opening and closing of the pores" in medical classics involve human physiological mechanisms, and "governing by non-action" and "following the natural way" in philosophical works are abstract concepts of governance. Moreover, the same word has vastly different meanings in different fields. For instance, the word "qi" in the context of traditional Chinese medicine refers to the life energy circulating in the human body, in the context of philosophy it can refer to the fundamental substance of all things in the universe, and in the context of military affairs it often refers to the morale or momentum of the army. However, directly using large language model translation methods completely lacks domain recognition capabilities, failing to handle all types of classical Chinese input in a uniform manner. While the standard RAG method introduces external retrieval, it only performs pure semantic matching within a single global index, treating all domain inputs equally. It cannot identify the domain affiliation of the input text, nor can it dynamically adjust retrieval strategies and translation guidance based on domain characteristics. This domain-agnostic approach easily leads to situations where, during the retrieval phase, semantically similar but domain-mismatched sentence pairs from other domains are ranked before relevant references within the domain, thus "drowning" valuable professional reference translations. In fields with highly unique terminology systems, such as medicine and military, the cross-domain noise returned by global retrieval has a particularly significant impact on translation quality.
[0013] Second, existing methods lack the ability of multi-granularity semantic alignment. The standard RAG method can only provide sentence-level reference information, that is, showing several groups of semantically similar ancient and modern Chinese complete sentence pairs to the large language model, expecting the model to independently summarize the corresponding relationships and translation patterns of terms. However, ancient Chinese uses words concisely, with the phenomenon of one word having multiple meanings being common, and there are also a large number of complex language phenomena such as ancient and modern different words, borrowed characters, and word-class flexible uses. For example, the character "兵" can refer to soldiers, weapons, military operations, or war itself respectively; "走" means "run" in ancient Chinese rather than "walk" in modern Chinese; "妻子" refers to "wife and children" in ancient Chinese rather than just the spouse; "牺牲" means "sacrificial animals" in ancient Chinese rather than "give up one's life" in modern Chinese.仅凭句子级的参考样例,大语言模型难以准确捕捉细粒度的古今语义对应关系,当参考句对中的关键术语与输入文本不完全重合时,模型因缺乏明确的字词级释义指导,只能依托自身不甚可靠的内部知识进行推断,导致关键术语的翻译准确率不稳定;直接使用大语言模型翻译方法无任何参考信息支撑,完全依赖参数化知识进行字词级的语义消歧,这一问题则更为突出。
[0014] Third, existing methods lack the ability of automatic detection and tracing of allusions. Ancient Chinese literati had a profound tradition of using allusions. When writing, they extensively cited historical events, quotations of sages, and classic chapters to convey rich semantic information and cultural connotations with concise words. Moreover, these allusion citations are mostly in implicit forms without additional annotations, and the author assumes that the reader has the corresponding knowledge background. For example, in "百战奇略", "此王邑所以耻过昆阳也" implies the historical allusion of the Battle of Kunyang in the Eastern Han Dynasty; "先为不可胜,以待敌之可胜" directly quotes the classic strategic thought from "孙子兵法·军形篇"; "攻其所必救" paraphrases the combat principle from "孙子兵法·虚实篇". At the same time, many allusions will appear in variant forms. For example, "卧薪尝胆" can be abbreviated as "尝胆", and "鸿门宴" can be implied only by "项庄舞剑". However, both the direct large language model translation and the standard RAG method cannot automatically detect the allusion citations in the input text, let alone trace the original source books, chapters, and original text contexts of the allusions: The direct large language model translation can only rely on the allusion knowledge accidentally acquired during model training and is extremely likely to miss rare or variant allusions; Although the retrieval of the standard RAG method may accidentally hit sentence pairs related to the source of the allusion, this kind of hit is non-systematic and uncontrollable, and is not a conscious allusion detection behavior. The lack of allusion recognition ability will lead to a large amount of allusion information carrying deep semantic and cultural connotations being ignored during the translation process, ultimately causing the translated text to lose the ideological depth and cultural depth of the original text.
[0015] Fourth, the translation process of existing methods lacks interpretability. Both direct translation using large language models and the standard RAG method present the translation results as a "black box." Users can only obtain the final translated output, but cannot understand the reasoning and evidence behind the translation decisions. They cannot know the system's logic for classifying the input text's domain, which reference translations influenced the final translation, or the source information for key terminology and classical allusions. This lack of transparency is particularly prominent in academic research and education. Researchers of classical Chinese need to judge the credibility of the translation based on the reasoning process, and teachers need to demonstrate the reasoning logic of translation to students to aid teaching. Existing methods fail to meet these needs. Although the standard RAG method performs retrieval operations internally, its retrieval results are only used as part of the model input in the generation process, without transparently displaying the retrieval strategy, matching criteria, and evidence chain to the user. In practical applications, a qualified classical Chinese translation system not only needs to output accurate translations, but also needs to provide a complete chain of evidence for translation decisions, including domain-specific criteria, search reference sources, keyword-level definitions, and source tracing of allusions, so that the translation results are usable, verifiable, and traceable.
[0016] In summary, the systematic deficiencies of existing methods for translating Classical Chinese in four dimensions—domain adaptability, multi-granularity semantic alignment, allusion detection and tracing, and translation interpretability—constitute the core bottleneck restricting the quality and practical value of Classical Chinese translation. Summary of the Invention
[0017] The purpose of this invention is to provide a method and system for intelligent translation of classical Chinese based on domain-adaptive retrieval enhancement, thereby solving the aforementioned technical problems.
[0018] To achieve the above objectives, this invention provides an intelligent translation method for Classical Chinese based on domain-adaptive retrieval enhancement, comprising the following steps:
[0019] S1. Construct a basic resource library for classical Chinese translation, which includes a domain centroid vector set, a multi-granularity semantic alignment knowledge base, a global parallel corpus vector index, and domain-specific parallel corpus vector indexes.
[0020] S2. The input classical Chinese text is semantically encoded using the bge-large-zh-v1.5 pre-trained semantic vector model to obtain the input semantic vector. The cosine similarity between the input semantic vector and the centroid vectors of each domain in the domain centroid vector set in S1 is calculated. The domain corresponding to the maximum cosine similarity is determined as the target domain of the input classical Chinese text, and the maximum cosine similarity is regarded as the domain determination confidence.
[0021] S3. Based on the target domain and domain determination confidence obtained in S2, perform dual-source fusion retrieval: retrieve from the global parallel corpus vector index and the target domain-specific parallel corpus vector index of S1 respectively to obtain global candidate reference sentence pairs and domain candidate reference sentence pairs, merge them, and output the optimal reference translation set after deduplication, fusion scoring and quality lower limit filtering.
[0022] S4. Extract two-character words, three-character phrases, and four-character phrases from the input classical Chinese text. Perform maximum matching query on the extracted multi-granularity fragments in the multi-granularity semantic alignment knowledge base of S1 in order from longest to shortest. Extract the classical Chinese-modern Chinese semantic mapping entries with a mutual information value not lower than a set threshold from the query results as high-confidence classical and modern interpretation information.
[0023] S5. Extract phrases of 4-8 characters from the input classical Chinese text as candidate allusion fragments. After semantically encoding the candidate allusion fragments using the bge-large-zh-v1.5 pre-trained semantic vector model, perform an approximate nearest neighbor search in the global parallel corpus vector index of S1 to obtain semantic similarity matching results. Perform cross-book verification, adaptive similarity threshold filtering, and deduplication on the semantic similarity matching results to obtain the matching result with the highest similarity and determine it as an allusion citation. Extract the source book, specific chapter, original text, and modern Chinese translation corresponding to the allusion citation as complete allusion source information.
[0024] S6. Based on the target domain obtained in S2, generate domain adaptive system instructions. Integrate the domain adaptive system instructions, the optimal set of reference translations obtained in S3, the high-confidence ancient and modern interpretation information obtained in S4, and the complete allusion tracing information obtained in S5 according to the preset structure to construct a domain adaptive structured translation prompt.
[0025] S7. Input the domain-adaptive structured translation prompts constructed in S6 into the Qwen series large language model to generate the modern Chinese translation corresponding to the input classical Chinese original text;
[0026] S8 integrates the target domain and domain determination confidence of S2, the dual-source fusion retrieval score results and the optimal reference translation set of S3, the high-confidence ancient and modern interpretation information of S4, and the complete allusion tracing information of S5 to generate an interpretable translation evidence chain containing a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and an allusion tracing layer, and outputs the modern Chinese translation obtained in S7 and the interpretable translation evidence chain simultaneously.
[0027] The system for implementing an intelligent translation method for classical Chinese based on domain-adaptive retrieval enhancement includes: a basic resource database construction module, a domain determination module, a dual-source fusion retrieval module, a multi-granularity semantic alignment query module, an automatic allusion detection and source tracing module, a domain-adaptive structured prompt construction module, a translation generation module, and an interpretable evidence chain generation and synchronous output module.
[0028] Among them, the basic resource library construction module is used to build a basic resource library for classical Chinese translation. The basic resource library for classical Chinese translation includes a domain centroid vector set, a multi-granularity semantic alignment knowledge base, a global parallel corpus vector index, and a domain-specific parallel corpus vector index.
[0029] The domain determination module is used to semantically encode the input classical Chinese text using the bge-large-zh-v1.5 pre-trained semantic vector model to obtain the input semantic vector. It calculates the cosine similarity between the input semantic vector and the centroid vectors of each domain in the domain centroid vector set in S1. The domain corresponding to the maximum cosine similarity is determined as the target domain of the input classical Chinese text, and the maximum cosine similarity is regarded as the domain determination confidence.
[0030] The dual-source fusion retrieval module is used to perform dual-source fusion retrieval based on the target domain and the domain-specific confidence score: it retrieves global candidate reference sentence pairs and domain candidate reference sentence pairs from the global parallel corpus vector index and the target domain-specific parallel corpus vector index respectively, and then merges them. After deduplication, fusion scoring and quality lower limit filtering, the optimal set of reference translations is output.
[0031] The multi-granularity semantic alignment query module is used to extract two-character words, three-character phrases, and four-character phrases from the input classical Chinese text. The extracted multi-granularity fragments are then subjected to a maximum matching query in the multi-granularity semantic alignment knowledge base in descending order of length. Classical Chinese-modern Chinese semantic mapping entries with a mutual information value of not less than a set threshold are extracted from the query results and used as high-confidence ancient and modern interpretation information.
[0032] The automatic allusion detection and tracing module extracts 4-8 character phrases from the input classical Chinese text as candidate allusion fragments. After semantically encoding the candidate allusion fragments using the bge-large-zh-v1.5 pre-trained semantic vector model, it performs an approximate nearest neighbor search in the global parallel corpus vector index to obtain semantic similarity matching results. The semantic similarity matching results are then subjected to cross-book verification, adaptive similarity threshold filtering, and deduplication to obtain the matching result with the highest similarity and determine it as an allusion citation. The module extracts the source book, specific chapter, original text, and modern Chinese translation corresponding to the allusion citation as complete allusion tracing information.
[0033] The domain-adaptive structured prompt building module is used to generate domain-adaptive system instructions based on the target domain. It integrates the domain-adaptive system instructions, the optimal set of reference translations, high-confidence ancient and modern interpretations, and complete allusion tracing information according to a preset structure to build domain-adaptive structured translation prompts.
[0034] The translation generation module is used to input domain-adaptive structured translation prompts into the Qwen series of large language models and generate modern Chinese translations corresponding to the input classical Chinese original text.
[0035] The module for generating and synchronously outputting an interpretable evidence chain is used to integrate the target domain and domain determination confidence, dual-source fusion retrieval scoring results and the best reference translation set, high-confidence ancient and modern interpretation information, and complete allusion tracing information to generate an interpretable translation evidence chain that includes a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and an allusion tracing layer, and synchronously outputs the modern Chinese translation and the interpretable translation evidence chain.
[0036] Therefore, the present invention employs the above-mentioned domain-adaptive retrieval-enhanced intelligent translation method and system for Classical Chinese, which has the following beneficial effects:
[0037] 1. Improve the domain adaptability and professional accuracy of translation: Automatically identify and assess the confidence level of the input classical Chinese original text. Combined with a global + domain-specific dual-source fusion retrieval strategy, prioritize matching professional reference translations within the domain, avoid cross-domain semantically similar sentences from overwhelming professional content, effectively solve the problem of cross-domain noise interference in professional fields such as military and medicine, and significantly improve the accuracy of professional terminology translation.
[0038] 2. Enhance multi-granular semantic understanding and reduce the risk of mistranslation of key terms: Construct a multi-granular semantic alignment knowledge base at the level of two-character words, three-character phrases, and four-character phrases. Through the maximum matching query from long to short, it provides accurate word-level ancient and modern interpretation support for translation, effectively dealing with complex language phenomena such as polysemy, differences between ancient and modern meanings, and phonetic loan characters in classical Chinese. It solves the problem that existing methods can only provide sentence-level references and lack fine-grained semantic mapping.
[0039] 3. Achieve systematic detection and source tracing of allusions and restore the original cultural connotations: Through cross-text semantic retrieval and cross-book verification, adaptive similarity threshold filtering, and deduplication multi-dimensional judgment logic, it can automatically identify hidden allusions and variant allusions in ancient texts, and trace their source books, chapters, original texts and modern translations, making up for the shortcomings of existing methods in allusion identification, and allowing the translation to retain the original text's intellectual depth and cultural breadth;
[0040] 4. Achieve full interpretability in the translation process and meet diverse practical application needs: Generate a complete and interpretable translation evidence chain that includes a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and a classical allusion tracing layer. This breaks the "black box" output limitation of traditional classical Chinese translation methods, making the basis for translation decisions traceable and meeting the verifiable needs of classical Chinese academic research and the teaching and explanation needs of educational popularization.
[0041] 5. Low deployment cost, strong practicality, and compatibility with existing technology systems: The core design is to optimize the input reference set of large language models rather than modify the model itself, without the need for large-scale additional training of large models; basic resources such as domain centroid vector sets and multi-granularity semantic alignment knowledge bases are all built once and reused persistently, and are implemented based on mature open-source semantic models and vector databases, making the technology easy to implement and easy to integrate with existing natural language processing technology systems.
[0042] 6. Comprehensively avoids illusory translations and improves overall translation fidelity: It provides sufficient external knowledge evidence support for the large language model from three levels: domain, words, and allusions. It completely solves the problem of illusory translations that are "seemingly fluent but actually distorted" caused by pure parameterized implicit knowledge in direct large language model translation. At the same time, it makes up for the retrieval limitations of the standard RAG method and greatly improves the overall accuracy and fidelity to the original text in classical Chinese translation.
[0043] In summary, this invention, through the organic integration of domain-aware retrieval optimization, word-level semantic alignment knowledge base, and cross-text allusion tracing mechanism, provides users with a transparent and traceable multi-layered translation evidence chain while comprehensively improving the accuracy of classical Chinese translation, thereby achieving high-quality intelligent translation of classical Chinese documents.
[0044] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0045] Figure 1 This is a flowchart of the intelligent translation method for Classical Chinese based on domain adaptive retrieval enhancement as described in this invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.
[0047] It should be noted that the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as a process, method, system, product, or server that includes a series of steps or units, not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.
[0048] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0049] like Figure 1 As shown, the intelligent translation method for Classical Chinese based on domain-adaptive retrieval enhancement includes the following steps:
[0050] S1. Construct a basic resource library for classical Chinese translation. This basic resource library includes a domain centroid vector set, a multi-granularity semantic alignment knowledge base, a global parallel corpus vector index, and domain-specific parallel corpus vector indexes.
[0051] S2. The input Classical Chinese text is semantically encoded using the bge-large-zh-v1.5 pre-trained semantic vector model to obtain the input semantic vector. The cosine similarity between the input semantic vector and the centroid vectors of each domain in the domain centroid vector set in S1 is calculated. The domain corresponding to the maximum cosine similarity is determined as the target domain of the input Classical Chinese text, and the maximum cosine similarity is regarded as the domain determination confidence. For example, when a piece of military strategy text is input, the system may output: military 0.72, philosophy 0.58, history 0.51, medicine 0.43, thus determining that the text belongs to the military domain with a confidence of 0.72.
[0052] S3. Based on the target domain and domain determination confidence obtained in S2, perform dual-source fusion retrieval: retrieve from the global parallel corpus vector index and the target domain-specific parallel corpus vector index in S1 respectively to obtain global candidate reference sentence pairs and domain candidate reference sentence pairs, merge them, and output the optimal reference translation set after deduplication, fusion scoring and quality lower limit filtering.
[0053] S4. Extract multi-granularity segments of two-character words, three-word phrases, and four-word phrases from the input classical Chinese original text. Perform a maximum matching query on the extracted multi-granularity segments in the multi-granularity semantic alignment knowledge base in S1 in descending order of length. Extract the classical Chinese - modern Chinese semantic mapping entries with point mutual information values not lower than the set threshold (set to 9.0 in this embodiment) as high-confidence ancient and modern interpretation information. In this embodiment, four-word phrases are preferentially matched. If a match is successful, shorter-granularity matching is no longer performed on the already matched range. If no match is found, three-word phrases are tried, and finally two-character words are tried. This strategy ensures that longer segments with more complete semantics are preferentially matched, avoiding splitting four-word idioms into multiple two-character words for separate interpretations and losing the overall semantics.
[0054] S5. Extract phrase segments of 4 - 8 characters from the input classical Chinese original text as candidate allusion segments. The lower length limit is set to 4 characters because the typical form of Chinese allusions is four-word idioms or fixed expressions of more than four characters (such as "First make oneself invincible" and "Attack where the enemy must rescue"). The upper length limit is set to 8 characters because segments longer than 8 characters are usually complete sentences rather than allusion citations. Longer segments are preferentially selected during extraction because they carry more semantic information and have higher detection accuracy. After semantic encoding of the candidate allusion segments using the bge-large-zh-v1.5 pre-trained semantic vector model, perform approximate nearest neighbor search in the global parallel corpus vector index in S1 to obtain semantic similarity matching results. Perform cross-book verification, adaptive similarity threshold screening, and deduplication on the semantic similarity matching results to obtain the matching result with the highest similarity and determine it as an allusion citation. Extract the source book, specific chapter, original text of the original work, and modern Chinese translation corresponding to the allusion citation as complete allusion tracing information. For example, when the system detects that "First make oneself invincible, and then wait for the enemy to become vulnerable" is an allusion citation, it will return: The source is "The Art of War - Military Form", the original text is "Those who were good at war in ancient times first made themselves invincible and then waited for the enemy to become vulnerable", and the modern interpretation is "Those who were good at war in the past first made themselves in a position where they could not be defeated, and then waited for the opportunity when the enemy could be defeated".
[0055] S6. Generate domain-adaptive system instructions based on the target domain obtained in S2 (for example, "This is a military literature on the art of war. Please pay attention to accurately translating military terms and descriptions of strategic deployments"). Integrate the domain-adaptive system instructions, the optimal reference translation set obtained in S3, the high-confidence ancient and modern interpretation information obtained in S4, and the complete allusion tracing information obtained in S5 according to a preset structure to construct a domain-adaptive structured translation prompt.
[0056] S7. Input the domain-adaptive structured translation prompt constructed in S6 into the Qwen series large language model to generate the modern Chinese translation corresponding to the input classical Chinese original text.
[0057] S8 integrates the target domain and domain determination confidence of S2, the dual-source fusion retrieval score results and the optimal reference translation set of S3, the high-confidence ancient and modern interpretation information of S4, and the complete allusion tracing information of S5 to generate an interpretable translation evidence chain containing a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and an allusion tracing layer, and outputs the modern Chinese translation obtained in S7 and the interpretable translation evidence chain simultaneously.
[0058] Step S1 specifically includes the following steps:
[0059] S11. Construct a set of centroid vectors for the domain (the centroid vectors represent the typical semantic features of the ancient Chinese texts in the domain. This calculation only needs to be performed once, and the results can be persistently stored and reused).
[0060] S111. The presupposed fields for classical Chinese translation are determined to be four major fields: military, philosophy, history, and medicine. Representative classical Chinese sentences are sampled from bilingual parallel corpora of classical and modern Chinese in each field.
[0061] S112. Using the bge-large-zh-v1.5 pre-trained semantic vector model, representative Classical Chinese sentences from various fields are semantically encoded to obtain the semantic encoding vectors corresponding to each sentence. ,in, For the first In the first field Semantic encoding vectors of representative Classical Chinese sentences.
[0062] S113. Semantic encoding vectors for all representative Classical Chinese sentences within the same domain. Take the arithmetic mean to obtain the centroid vector of this area:
[0063] ;
[0064] In the formula, For the first Centroid vector of each domain; For the first The number of representative sentences used in each field.
[0065] S114. Merge the centroid vectors of all domains to obtain the domain centroid vector set.
[0066] S12. Construct a multi-granularity semantic alignment knowledge base.
[0067] S121. The classical Chinese texts in the classical Chinese-modern Chinese bilingual parallel corpus are subjected to n-gram extraction of two-character words, three-character phrases, and four-character phrases to generate a multi-granularity candidate set of classical Chinese fragments; simultaneously, the modern Chinese texts in the parallel corpus are segmented using the jieba word segmentation tool to generate a set of modern words; among them, is the number of characters and ; for example, for "strengthening the defenses and clearing the fields", the system will extract candidate segments such as "strengthening the defenses", "defenses cleared", "clearing the fields", "strengthening the defenses and cleared", "defenses cleared and fields", "strengthening the defenses and clearing the fields".
[0068] S122. Based on sentence alignment, traverse all bilingual parallel corpus pairs, and count the frequency of co-occurrence of each ancient Chinese segment and each modern word in the same sentence pair, and at the same time count the frequency of occurrence of the ancient Chinese segment , the frequency of occurrence of the modern word , , the frequency of occurrence of the modern word , and the total number of sentence pairs in the corpus .
[0069] S123. Calculate the point mutual information value between the ancient Chinese segment and the modern word:
[0070] ;
[0071] where
[0072] ;
[0073] ;
[0074] ;
[0075] In the formula, is the point mutual information value between the ancient Chinese segment and the modern word ; is the co-occurrence frequency between the ancient Chinese segment and the modern word ; is the occurrence probability of the ancient Chinese segment in the corpus; is the occurrence probability of the modern word in the corpus.
[0076] S124. Filter out (to ensure the association strength) or (to ensure the statistical reliability and avoid false high PMI caused by accidental co-occurrence) or ancient Chinese - modern Chinese mapping pairs with the length of the ancient Chinese segment less than 2 (filtering out single-character noise), and arrange the filtered ancient Chinese - modern Chinese mapping pairs according to Sort in descending order to construct a multi-granularity semantic alignment knowledge base; the storage structure is: {Classical Chinese fragment → [(Modern interpretation, PMI value, frequency, source book)]. For example: "坚壁" → "坚守壁垒" (PMI = 9.2), "深沟高垒" → "深挖壕沟, 高筑壁垒" (PMI = 10.1). This knowledge base only needs to be constructed once and can be persistently stored and reused.
[0077] S13. Construct a global parallel corpus vector index.
[0078] S131. Collect the full-scale ancient Chinese - modern Chinese bilingual parallel corpus (including the military, philosophy, history, and medicine fields) to form a global parallel corpus.
[0079] S132. Use the bge-large-zh-v1.5 pre-trained semantic vector model to perform semantic encoding on the ancient Chinese texts in the global parallel corpus to obtain the corresponding semantic vectors;
[0080] S133. Associate the semantic vectors of the ancient Chinese texts obtained in S132 with the corresponding ancient Chinese - modern Chinese sentence pairs, and construct a global parallel corpus vector index that supports approximate nearest neighbor search based on the Chroma DB vector database.
[0081] S14. Construct a dedicated parallel corpus vector index for each field.
[0082] S141. Divide the global parallel corpus into subsets according to the military, philosophy, history, and medicine fields to obtain dedicated parallel corpus subsets for each field.
[0083] S142. Use the bge-large-zh-v1.5 pre-trained semantic vector model to perform semantic encoding on the ancient Chinese texts in the dedicated corpus subsets for each field to obtain the corresponding semantic vectors.
[0084] S143. Associate the semantic vectors of the ancient Chinese texts obtained in S142 with the corresponding bilingual sentence pairs, and respectively construct dedicated parallel corpus vector indexes for each field based on the Chroma DB vector database.
[0085] Step S3 specifically includes the following steps:
[0086] S31. Global parallel corpus vector index retrieval: Perform 2-fold over-retrieval from the global parallel corpus vector index (2-fold over-retrieval ensures that there are sufficient high-quality global candidates for subsequent fusion), and calculate the mixed score of the input ancient Chinese original text and the global candidate reference sentence pairs :
[0087] ;
[0088] In the formula, For the semantic similarity between the input classical Chinese original text and the global candidate reference sentence pairs, the semantic similarity is the cosine distance based on the bge-large-zh-v1.5 model; For the lexical similarity between the input classical Chinese original text and the global candidate reference sentence pairs, the lexical similarity is the bigram overlap rate (the proportion of the intersection of two-character segments) based on the input text and the candidate classical Chinese, which is used to capture the direct overlap at the keyword level that may be missed by the semantic vector).
[0089] The design of the hybrid scoring formula adopts "semantics first and lexicon second" because in the classical Chinese translation scenario, sentence meaning matching mainly relies on semantic similarity. Although lexical similarity can supplement hard lexical clues such as personal names, place names, official positions, etc., it is also easily interfered by high-frequency words such as "之", "者", "也", "曰". If the lexical weight is too high, the retrieval ranking will be disturbed by the surface literal overlap, which will instead reduce the quality of the reference sentence pairs.
[0090] To verify the rationality of this value, in this embodiment, a pure retrieval-side ablation experiment was carried out on 100 random test samples.
[0091] Table 1 Results of the hybrid retrieval weight ablation experiment ( and respectively represent and weights)
[0092]
[0093] As can be seen from Table 1, when using the 0.9 / 0.1 weight, the average semantic similarity is 0.699, which hardly decreases compared to 0.700 of the pure semantic retrieval. At the same time, the average lexical similarity increases from 0.097 to 0.117, indicating that a small amount of lexical signals are indeed incorporated. In the downstream translation task, the BLEU score increases by 1.28 compared to the weight allocation of 0.7 / 0.3, proving that the lexical auxiliary signal can effectively improve the translation quality.
[0094] S32. Sort in descending order and select the top 2000 candidate sentence pairs as the global candidate reference sentence pairs (in this embodiment, retrieve 2×Top-K candidate sentence pairs from the global index containing all 18,947 pieces of corpus).
[0095] S33. Retrieval of the domain-specific parallel corpus vector index: Conduct 1-fold retrieval from the domain-specific parallel corpus vector index of the target domain and sort by semantic similarity The descending order sorting yields candidate reference sentence pairs for the domain; the domain index contains only a subset of the corpus for that domain, enabling the retrieval of domain-specific references that might be buried by cross-domain noise in the global index. For example, when the input is a text from a traditional Chinese medicine classic, the medical index can return reference sentence pairs containing professional terms such as "upper jiao" and "couli," which might be ranked lower in the global search by semantically similar sentence pairs from other domains.
[0096] S34. Merging and Deduplication of Candidate Sentence Pairs: Merge global candidate reference sentence pairs with domain candidate reference sentence pairs, and perform deduplication using the ancient Chinese source text as the unique key. During deduplication, global candidate reference sentence pairs are retained to obtain candidate reference sentence pairs.
[0097] S35. Fusion Score Calculation: Calculate the fusion score for all candidate reference sentences after deduplication. :
[0098] ;
[0099] in,
[0100] .
[0101] In the formula, Add points to the field; The confidence level of the domain determination obtained in step S2;
[0102] It should be noted that the above formula is used when the confidence level of the domain determination reaches a preset threshold. If the candidate sentence's domain matches the domain determined by the input text, a domain score of 0.015 is awarded; otherwise, the score is 0. This domain score is not intended to cover semantic similarity, but rather to represent a preference for sentences within the same domain when semantic distance is close, thus preventing near-tie situations.
[0103] To verify whether the bonus points actually work, this project conducted two sets of pure retrieval-side experiments on 100 test samples. The first set of experiments counted the semantic similarity differences between adjacent candidates in the Top-8 candidates of each sample, resulting in 700 sets of adjacent differences.
[0104] Table 2 Distribution of semantic similarity differences between Top-K neighboring candidates
[0105]
[0106] As shown in Table 2, among the Top-K candidates in dense vector retrieval, the semantic scores of adjacent candidates are often very close, with 81.0% of the adjacent differences falling within 0.015. Therefore, the 0.015 bonus is not only effective in a very few cases, but is on the same order of magnitude as the actual candidate score difference.
[0107] Table 3. Impact of Domain-Specific Bonus Points on Top-K Search Results
[0108]
[0109] As shown in Table 3, the Top-K set of 38 out of 100 samples changed due to domain scoring, the Top-K ranking of 46 samples changed, and a total of 46 candidates from the same domain entered the Top-K due to scoring. These changes directly affect the reference sentence pairs visible during subsequent large language model translation. Therefore, the value of 0.015 is intentionally small but practically effective: it is sufficient to reflect domain preference among a large number of semantically similar candidates, without causing low-quality candidates from the same domain to overtake obviously more similar candidates from across domains.
[0110] S36, Removal Candidate reference sentences.
[0111] S37. The candidate reference sentence pairs filtered by S36 are processed according to... Arrange the candidate reference sentence pairs in descending order and select the first preset number as the optimal reference translation set.
[0112] The cross-book verification in step S5 is as follows: the semantic similarity matching results are filtered, and only the matching results that are different from the books to which the input ancient Chinese original text belongs are retained, while text duplication within the same book is excluded.
[0113] The adaptive similarity threshold filtering involves applying a similarity threshold to the matching results after cross-book verification, and calculating the adaptive similarity threshold for each candidate allusion fragment. Only retain The matching results; where, This indicates the actual character length of the candidate allusion fragment, and .
[0114] It should be noted that the adaptive similarity threshold formula means that: the base threshold of 0.82 is used for 8-character candidate segments, and the threshold is increased by 0.03 for every 1 character reduced in the segment.
[0115] Table 4. Adaptive similarity threshold varies with candidate length
[0116]
[0117] To verify the effectiveness of the value 0.82 in the adaptive similarity threshold formula, the following explanation is provided:
[0118] In this embodiment, BAAI / bge-large-zh-v1.5 is used as the semantic vector model. BAAI states in the HuggingFace model FAQ that after the BGE model is trained with contrastive learning at a temperature coefficient of 0.01, the similarity distribution is roughly in the range of [0.6, 1]. Therefore, a similarity greater than 0.5 does not necessarily mean that the two sentences are similar.
[0119] Under the BGE model, values like 0.66 and 0.70 are still near the low end of the model's similarity distribution and cannot be used as thresholds for "high similarity cross-book matching" in allusion detection. Allusion detection also differs from general topic-related retrieval; it aims to identify cross-book citation relationships. Many sentences in ancient texts may have similar themes and wording, but no citation relationship exists. If the threshold is too low, it's easy to misclassify these thematically similar but non-allusion-referenced passages as allusions. Therefore, low thresholds like 0.66 and 0.70 cannot be used as basic thresholds.
[0120] In this embodiment, within the threshold range above 0.8 in the BAAI official example, 0.82 is selected as the basic threshold for candidate segments containing the character "8". This value is slightly higher than 0.8 to exclude weakly related matches; at the same time, it is lower than 0.85 to avoid over-tightening candidate segments such as "8" with relatively sufficient context, which could lead to missed detections. Therefore, 0.82 is not set arbitrarily, but is a basic high similarity threshold determined under the joint constraints of the BGE model similarity distribution, the official threshold example, and the cross-book allusion detection scenario.
[0121] The value of 0.03 is determined based on the length compensation constraint of 4-8 character candidate segments after the base threshold of 0.82 is established. Specifically, in the adaptive similarity threshold formula ( Among them, the most stringent is the 4-character candidate segment, with a threshold of 1. The step size cannot be too large, otherwise the 4-character threshold will approach or even exceed the upper limit of cosine similarity of 1.0. For example, when When the threshold for 4-character segments reaches 0.82 + 4 × 0.05 = 1.02, it exceeds the theoretical upper limit of cosine similarity, which is clearly undesirable. Even slightly below 0.05 would cause the threshold for short segments to approach 1.0 excessively, significantly suppressing recall. Simultaneously, the step size cannot be too small; otherwise, the threshold differences between segments of different lengths will be insignificant, and the adaptive mechanism will approach a fixed threshold. For example, when... At that time, the threshold difference between 4-character and 8-character segments is less than 4 × 0.02 = 0.08, which is insufficient to fully reflect the requirement for stricter judgment in short segments. Therefore, combining upper and lower bound constraints, A reasonable range is [0.02, 0.04].
[0122] In this embodiment, the intermediate value 0.03 within this range is taken, and the threshold for the 4-character candidate segment is: 0.82 + 4×0.03 = 0.94; on the one hand, this value is significantly higher than 0.82 for the 8-character candidate segment, reflecting the stricter requirements for short segments; on the other hand, it is still lower than 1.0, retaining the recall space of the semantic vector model for synonymous and variant expressions. Therefore, 0.03 is a reasonable step size for the embodiment determined under the characteristics of the BGE similarity distribution, the upper limit of the cosine similarity, and the requirement for controlling misdetection of short segments.
[0123] It should also be noted that in this embodiment, phrase segments of 4 to 8 characters are extracted from the input classical Chinese original text as candidate allusion segments. Since the semantic information volume of strings less than 4 characters is too low to stably form recognizable allusion reference units, they are not used as allusion candidates in this embodiment; continuous texts longer than 8 characters are not directly input into this threshold formula as single candidate allusion segments either, but can participate in the detection through 4- to 8-character sliding segments, or be covered by the sentence-level dual-source fusion retrieval mechanism. Therefore, The situation of being less than 4 or greater than 8 does not lack a threshold calculation method, but will not be input into the threshold screening link as a candidate allusion segment in this step; that is or when this occurs, this string does not enter the allusion candidate determination process.
[0124] At the same time, the above length range also conforms to the linguistic characteristics of Chinese allusions. Chinese allusions and fixed expressions usually appear in the form of four characters or more than four characters, such as "sleeping on brushwood and tasting gall", "breaking the cauldrons and sinking the boats", "first making oneself invincible", "attacking where the enemy must rescue", etc.; while segments longer than 8 characters usually approach complete clauses, and their recognition task is closer to sentence-level similarity retrieval rather than phrase-level allusion segment detection. Therefore, limiting the candidate allusion segments to 4 to 8 characters is a limitation on the processing object of this method, rather than omitting the threshold calculation rules for other lengths.
[0125] The deduplication process is as follows: Deduplicate the matching results after screening by the adaptive similarity threshold. When the same source book is matched by multiple candidate allusion segments, only retain the matching result with the highest semantic similarity and determine it as an allusion citation.
[0126] Finally, it should be noted that: The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that: They can still modify the technical solutions of the present invention or make equivalent substitutions, and these modifications or equivalent substitutions cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A domain-adaptive retrieval-enhanced intelligent translation method for Classical Chinese, characterized by: Includes the following steps: S1. Construct a basic resource library for classical Chinese translation, which includes a domain centroid vector set, a multi-granularity semantic alignment knowledge base, a global parallel corpus vector index, and domain-specific parallel corpus vector indexes. S2. The input classical Chinese text is semantically encoded using the bge-large-zh-v1.5 pre-trained semantic vector model to obtain the input semantic vector. The cosine similarity between the input semantic vector and the centroid vectors of each domain in the domain centroid vector set in S1 is calculated. The domain corresponding to the maximum cosine similarity is determined as the target domain of the input classical Chinese text, and the maximum cosine similarity is regarded as the domain determination confidence. S3. Based on the target domain and domain determination confidence obtained in S2, perform dual-source fusion retrieval: retrieve from the global parallel corpus vector index and the target domain-specific parallel corpus vector index of S1 respectively to obtain global candidate reference sentence pairs and domain candidate reference sentence pairs, merge them, and output the optimal reference translation set after deduplication, fusion scoring and quality lower limit filtering. S4. Extract two-character words, three-character phrases, and four-character phrases from the input classical Chinese text. Perform maximum matching query on the extracted multi-granularity fragments in the multi-granularity semantic alignment knowledge base of S1 in order from longest to shortest. Extract the classical Chinese-modern Chinese semantic mapping entries with a mutual information value not lower than a set threshold from the query results as high-confidence classical and modern interpretation information. S5. Extract phrases of 4-8 characters from the input classical Chinese text as candidate allusion fragments. After semantically encoding the candidate allusion fragments using the bge-large-zh-v1.5 pre-trained semantic vector model, perform an approximate nearest neighbor search in the global parallel corpus vector index of S1 to obtain semantic similarity matching results. Perform cross-book verification, adaptive similarity threshold filtering, and deduplication on the semantic similarity matching results to obtain the matching result with the highest similarity and determine it as an allusion citation. Extract the source book, specific chapter, original text, and modern Chinese translation corresponding to the allusion citation as complete allusion source information. S6. Based on the target domain obtained in S2, generate domain adaptive system instructions. Integrate the domain adaptive system instructions, the optimal set of reference translations obtained in S3, the high-confidence ancient and modern interpretation information obtained in S4, and the complete allusion tracing information obtained in S5 according to the preset structure to construct a domain adaptive structured translation prompt. S7. Input the domain-adaptive structured translation prompts constructed in S6 into the Qwen series large language model to generate the modern Chinese translation corresponding to the input classical Chinese original text; S8 integrates the target domain and domain determination confidence of S2, the dual-source fusion retrieval score results and the optimal reference translation set of S3, the high-confidence ancient and modern interpretation information of S4, and the complete allusion tracing information of S5 to generate an interpretable translation evidence chain containing a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and an allusion tracing layer, and outputs the modern Chinese translation obtained in S7 and the interpretable translation evidence chain simultaneously.
2. The method for intelligent translation of Classical Chinese based on domain-adaptive retrieval enhancement according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Construct the domain centroid vector set; S111. The presupposed fields for classical Chinese translation are determined to be four major fields: military, philosophy, history, and medicine. Representative classical Chinese sentences are sampled from bilingual parallel corpora of classical and modern Chinese in each field. S112. Using the bge-large-zh-v1.5 pre-trained semantic vector model, representative Classical Chinese sentences from various fields are semantically encoded to obtain the semantic encoding vectors corresponding to each sentence. ,in, For the first In the first field Semantic encoding vectors of representative Classical Chinese sentences; S113. Semantic encoding vectors for all representative Classical Chinese sentences within the same domain. Take the arithmetic mean to obtain the centroid vector of this area: ; In the formula, For the first Centroid vector of each domain; For the first The number of representative sentences used in each field; S114. Merge the centroid vectors of all domains to obtain the domain centroid vector set; S12. Construct a multi-granularity semantic alignment knowledge base; S121. The classical Chinese texts in the classical Chinese-modern Chinese bilingual parallel corpus are subjected to n-gram extraction of two-character words, three-character phrases, and four-character phrases to generate a multi-granularity candidate set of classical Chinese fragments; simultaneously, the modern Chinese texts in the parallel corpus are segmented using the jieba word segmentation tool to generate a set of modern words; among them, The number of characters and ; S122. Based on sentence alignment, traverse all bilingual parallel corpus pairs and statistically analyze each classical Chinese passage. With each modern word Frequency of co-occurrence in the same sentence pair At the same time, statistics were compiled on ancient text fragments. Frequency of occurrence Modern words Frequency of occurrence and the total number of sentences in the corpus ; S123. Calculate the point mutual information value between the classical Chinese passage and the modern words: ; in, ; ; ; In the formula, Classical Chinese text fragment With modern words Point mutual information value; Classical Chinese text fragment With modern words The frequency of their common occurrence; Classical Chinese text fragment Probability of occurrence in the corpus; For modern words Probability of occurrence in the corpus; S124, Filter out or Or, find Classical Chinese-Modern Chinese mapping pairs with a length of less than 2 characters, and then filter the obtained Classical Chinese-Modern Chinese mapping pairs according to... Sort in descending order and construct a multi-granularity semantically aligned knowledge base; S13. Construct a global parallel corpus vector index; S131. Collect a complete bilingual parallel corpus of Classical Chinese and Modern Chinese to form a global parallel corpus; S132. The bge-large-zh-v1.5 pre-trained semantic vector model is used to perform semantic encoding on the ancient Chinese texts in the global parallel corpus to obtain the corresponding semantic vectors; S133. Associate the semantic vectors of the ancient Chinese texts obtained in S132 with the corresponding ancient Chinese-modern Chinese sentence pairs, and construct a global parallel corpus vector index that supports approximate nearest neighbor search based on the Chroma DB vector database. S14. Construct vector indexes for parallel corpora specific to various fields; S141. Divide the global parallel corpus into military, philosophy, history and medicine fields to obtain dedicated parallel corpus subsets for each field; S142. The bge-large-zh-v1.5 pre-trained semantic vector model is used to perform semantic encoding on the ancient Chinese texts in the domain-specific corpus subsets to obtain the corresponding semantic vectors. S143. Associate the semantic vectors of the classical Chinese texts in each field obtained in S142 with the corresponding bilingual sentence pairs, and construct dedicated parallel corpus vector indexes for each field based on the Chroma DB vector database.
3. The method for intelligent translation of Classical Chinese based on domain adaptive retrieval enhancement according to claim 2, characterized in that: Step S3 specifically includes the following steps: S31. Global Parallel Corpus Vector Index Retrieval: Perform a 2x over-search from the global parallel corpus vector index and calculate the mixed score of the input Classical Chinese original text and global candidate reference sentence pairs. : ; In the formula, The semantic similarity between the input Classical Chinese original text and the global candidate reference sentence pairs is calculated using the cosine distance based on the bge-large-zh-v1.5 model. The lexical similarity between the input classical Chinese text and the global candidate reference sentence pairs is calculated, and the lexical similarity is based on the bigram overlap rate between the input text and the candidate classical Chinese text. S32, Press Sort the sentences in descending order and select the top 2000 candidate sentence pairs as global candidate reference sentence pairs; S33. Domain-Specific Parallel Corpus Vector Index Retrieval: Perform a 1x retrieval from the target domain-specific parallel corpus vector index, based on semantic similarity. Sort the candidate reference sentence pairs in descending order to obtain the domain; S34. Merging and Deduplication of Candidate Sentence Pairs: Merge global candidate reference sentence pairs with domain candidate reference sentence pairs, and deduplication is performed using the ancient Chinese source text as the unique key. During deduplication, global candidate reference sentence pairs are retained to obtain candidate reference sentence pairs. S35. Fusion Score Calculation: Calculate the fusion score for all candidate reference sentences after deduplication. : ; in, ; In the formula, Add points to the field; The confidence level of the domain determination obtained in step S2; S36, Removal Candidate reference sentence pairs; S37. The candidate reference sentence pairs filtered by S36 are processed according to... Arrange the candidate reference sentence pairs in descending order and select the first preset number as the optimal reference translation set.
4. The method for intelligent translation of Classical Chinese based on domain adaptive retrieval enhancement according to claim 3, characterized in that: The cross-book verification in step S5 is as follows: the semantic similarity matching results are filtered, and only the matching results that are different from the books to which the input ancient Chinese original text belongs are retained, and the text duplication within the same book is excluded; The adaptive similarity threshold filtering involves applying a similarity threshold to the matching results after cross-book verification, and calculating the adaptive similarity threshold for each candidate allusion fragment. Only retain The matching results; among which, This indicates the actual character length of the candidate allusion fragment, and ; The deduplication process involves removing duplicates from the matching results after adaptive similarity threshold filtering. When multiple candidate allusion fragments from the same book are matched, only semantic similarity is retained. The highest matching result is identified as a reference to a classical allusion.
5. An intelligent translation system for Classical Chinese, used to execute the intelligent translation method for Classical Chinese based on domain adaptive retrieval enhancement as described in any one of claims 1-4, characterized in that: include: The module includes a basic resource library construction module, a domain determination module, a dual-source fusion retrieval module, a multi-granularity semantic alignment query module, an automatic allusion detection and tracing module, a domain-adaptive structured prompt construction module, a translation generation module, and an interpretable evidence chain generation and synchronous output module. Among them, the basic resource library construction module is used to build a basic resource library for classical Chinese translation. The basic resource library for classical Chinese translation includes a domain centroid vector set, a multi-granularity semantic alignment knowledge base, a global parallel corpus vector index, and a domain-specific parallel corpus vector index. The domain determination module is used to semantically encode the input classical Chinese text using the bge-large-zh-v1.5 pre-trained semantic vector model to obtain the input semantic vector. It calculates the cosine similarity between the input semantic vector and the centroid vectors of each domain in the domain centroid vector set in S1. The domain corresponding to the maximum cosine similarity is determined as the target domain of the input classical Chinese text, and the maximum cosine similarity is regarded as the domain determination confidence. The dual-source fusion retrieval module is used to perform dual-source fusion retrieval based on the target domain and the domain-specific confidence score: it retrieves global candidate reference sentence pairs and domain candidate reference sentence pairs from the global parallel corpus vector index and the target domain-specific parallel corpus vector index respectively, and then merges them. After deduplication, fusion scoring and quality lower limit filtering, the optimal set of reference translations is output. The multi-granularity semantic alignment query module is used to extract two-character words, three-character phrases, and four-character phrases from the input classical Chinese text. The extracted multi-granularity fragments are then subjected to a maximum matching query in the multi-granularity semantic alignment knowledge base in descending order of length. Classical Chinese-modern Chinese semantic mapping entries with a mutual information value of not less than a set threshold are extracted from the query results and used as high-confidence ancient and modern interpretation information. The automatic allusion detection and tracing module extracts 4-8 character phrases from the input classical Chinese text as candidate allusion fragments. After semantically encoding the candidate allusion fragments using the bge-large-zh-v1.5 pre-trained semantic vector model, it performs an approximate nearest neighbor search in the global parallel corpus vector index to obtain semantic similarity matching results. The semantic similarity matching results are then subjected to cross-book verification, adaptive similarity threshold filtering, and deduplication to obtain the matching result with the highest similarity and determine it as an allusion citation. The module extracts the source book, specific chapter, original text, and modern Chinese translation corresponding to the allusion citation as complete allusion tracing information. The domain-adaptive structured prompt building module is used to generate domain-adaptive system instructions based on the target domain. It integrates the domain-adaptive system instructions, the optimal set of reference translations, high-confidence ancient and modern interpretations, and complete allusion tracing information according to a preset structure to build domain-adaptive structured translation prompts. The translation generation module is used to input domain-adaptive structured translation prompts into the Qwen series of large language models and generate modern Chinese translations corresponding to the input classical Chinese original text. The module for generating and synchronously outputting an interpretable evidence chain is used to integrate the target domain and domain determination confidence, dual-source fusion retrieval scoring results and the best reference translation set, high-confidence ancient and modern interpretation information, and complete allusion tracing information to generate an interpretable translation evidence chain that includes a domain determination layer, a retrieval reference layer, a keyword interpretation layer, and an allusion tracing layer, and synchronously outputs the modern Chinese translation and the interpretable translation evidence chain.