Method and device for performing Chinese and Mongolian translation on power industry terms based on artificial intelligence
By constructing a parallel corpus of Chinese and Mongolian languages for power industry terms and generating a hypergraph network for two-way semantic correlation, the problem of inaccurate translation of Mongolian languages in the power industry is solved, and efficient and accurate translation between China and Mongolian languages is achieved.
Patent Information
- Application Number
- CN202411654900.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
AI Technical Summary
The existing technology lacks systematic translation resources specifically for Mongolian language in the power industry, resulting in inaccurate translation of terms in the power industry or inability to translate, affecting the effective dissemination and application of business materials.
By constructing a Chinese parallel prediction library and a Mongolian parallel corpus for terms in the power industry, a hypergraph network of Chinese and Mongolian languages is generated, and a two-way semantic relationship is carried out to establish a two-way semantic mapping relationship between Chinese words in the power industry and Mongolian languages.
It has achieved accurate, efficient and semantic coherent Chinese-Mongolian mutual translation of terms in the power industry, improved the accuracy and efficiency of translation, and met the efficient development needs of power business in Mongolian-speaking areas.
Smart Images

Figure CN119578433A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a method and a device for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence. Background Art
[0002] With the continuous development of my country's power industry and the increasing frequency of foreign exchanges and cooperation, the application of Mongolian has become increasingly important in the expansion and communication and cooperation of power business in ethnic minority areas. For example, in Inner Mongolia and other areas where Mongolians live and have rich power-related businesses, power industry information, equipment operating instructions, technical specifications and other contents often need to be accurately translated between Chinese and Mongolian, so that staff, users and relevant business participants with different language backgrounds can understand and carry out their work smoothly. At present, the existing technologies for Mongolian processing in the power industry mainly have the following problems: First, there is a lack of systematic translation resources specifically for power industry terminology. Traditional general translation tools or methods do not focus on the specific field of the power industry. When dealing with highly professional terms in the power industry, inaccurate translation or even untranslatable situations often occur. For example, terms unique to the power industry, such as "substation integrated automation system" and "transmission line tower", are difficult to be accurately translated into corresponding words that conform to Mongolian habits and have accurate meanings in the context of general translation, which in turn affects the effective dissemination and application of relevant power business information among Mongolian speakers. Secondly, most of the existing translation methods are based on simple word-to-word mapping, which does not fully consider the semantic relevance of power industry terms and the deep semantic logical relationship between different languages. This leads to poor semantic coherence of the entire text after translating longer power text content, and it is difficult to accurately convey the complete meaning of the original text in the power business scenario. For example, a Chinese text about the power system fault diagnosis process, after being translated into Mongolian using conventional translation methods, may not be properly handled due to semantic associations, making it impossible for Mongolian readers to clearly understand the logic and professional meanings between each step, which will mislead the actual troubleshooting work in the power business. Third, in the business dealings of the power industry, there is a lack of efficient and accurate automated processing methods for mutual translation between Chinese and Mongolian. Although manual translation can guarantee accuracy to a certain extent, it is inefficient and cannot meet the needs of rapid translation of a large number of power business documents; and some existing machine translation methods, because they are not optimized for the characteristics of the power industry and Mongolian, cannot effectively guarantee the translation quality in practical applications, causing the power industry to spend a lot of manpower, material resources and time costs on Mongolian processing, hindering the efficient development of power business in Mongolian-speaking areas. In summary, in the business applications of the power industry, there is an urgent need for a method that can accurately process Mongolian, especially for accurate, efficient and semantically coherent Chinese-Mongolian translation of power industry terms. Summary of the invention
[0003] The present disclosure provides a method and device for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence. According to the first aspect of the present disclosure, a method for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence is provided, which includes: constructing a Chinese parallel prediction library and a Mongolian parallel corpus of electric power industry terms; based on the Chinese parallel prediction library, generating a Chinese hypergraph network of electric power industry terms; based on the Mongolian parallel corpus, generating a Mongolian hypergraph network of electric power industry terms; performing bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terms; obtaining electric power text content expressed in a first language to match with the bidirectional semantic mapping relationship to obtain circuit text content expressed in a second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese. According to a second aspect of the present disclosure, a device for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence is provided, which includes: a first program unit, used to construct a Chinese parallel forecast library and a Mongolian parallel corpus of electric power industry terms; a second program unit, used to generate a Chinese hypergraph network of electric power industry terms based on the Chinese parallel forecast library; a third program unit, used to generate a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel corpus; a fourth program unit, used to perform bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terms; the fourth program unit, used to obtain electric power text content expressed in a first language to match it with the bidirectional semantic mapping relationship to obtain circuit text content expressed in a second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese. According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] Figure 1 A flowchart of a method for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0005] Figure 1A flowchart of a method for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence according to an embodiment of the present disclosure is shown; Figure 1 As shown, the method for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence includes: constructing a Chinese parallel prediction library and a Mongolian parallel corpus of electric power industry terms; generating a Chinese hypergraph network of electric power industry terms based on the Chinese parallel prediction library; generating a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel corpus; performing bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terms; obtaining electric power text content expressed in a first language to match it with the bidirectional semantic mapping relationship to obtain circuit text content expressed in a second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese.
[0006] To this end, in the disclosed solution, firstly, a Chinese parallel corpus and a Mongolian parallel corpus of electric power industry terms are constructed, which is the basis for ensuring the accuracy of translation. Traditional general translation tools often lack the special collection and organization of professional terms in the electric power industry. The coverage of their lexicon mainly focuses on common words such as daily life expressions. For those highly professional terms with specific technical meanings in the electric power industry, such as "high-voltage switchgear (гавьяаныуранхэсэг)" and "relay protection device (жихээгшYYхгYйцэтгэххэрэгсэл)", it is difficult to accurately match the appropriate Mongolian translation in the general corpus. By specially constructing a parallel corpus of electric power industry terms, we focus on collecting various professional terms in this field and their corresponding Mongolian expressions, which can ensure that these key terms have accurate translation references from the root, avoid translation errors caused by missing or inaccurate corpus, and lay a solid foundation for the accuracy of the subsequent translation of the entire Chinese-Mongolian electric power text. In addition, the Chinese hypergraph network of power industry terms is generated based on the constructed Chinese parallel corpus, and the corresponding Mongolian hypergraph network is generated based on the Mongolian parallel corpus, and bidirectional semantic association is performed. This process further improves the translation accuracy. Compared with the traditional simple vocabulary or linear language structure representation, the hypergraph network can more comprehensively display the complex semantic relationship between power industry terms. For example, in the power system, "transformer (трансфoрматoр)" and "winding (хθлгθн)" and "iron core (сγрэг)" have a close component association relationship. In the Chinese hypergraph network and the Mongolian hypergraph network, this association can be clearly presented in the form of nodes and edges, and after bidirectional semantic association, when translating, it can accurately select Mongolian or Chinese expressions that conform to the context and industry habits based on this deep semantic connection. The establishment of this bidirectional semantic mapping relationship can also well handle the situation of multiple meanings of one word or multiple words with one meaning, which is also a common phenomenon in power industry terms. For example, the word "grounding (хавсаргах)" has subtle but important semantic differences in different power business scenarios (such as lightning protection grounding, equipment grounding, etc.). Through bidirectional semantic association, the accurate Mongolian corresponding expression of the word in the specific context can be accurately judged, and vice versa, so that the translation result is more in line with the actual meaning of the power business, greatly reducing the problem of inaccurate translation caused by semantic understanding deviation. Furthermore, the method of the present invention realizes an automated process from obtaining power text content to matching conversion based on the established bidirectional semantic mapping relationship by utilizing artificial intelligence. In the past, in the power industry, if manual Chinese-Mongolian translation was relied on, facing a large number of power business documents, such as power engineering construction plans, equipment maintenance manuals, etc., translators needed to search for information, analyze semantics and translate word by word, and this process was not only time-consuming and laborious, but also prone to errors due to factors such as human fatigue.The automated translation method provided by the disclosed solution only needs to input the power text content expressed in the first language (Chinese or Mongolian), and the system can quickly match and convert it according to the pre-built and associated semantic mapping relationship, and generate the corresponding second language (Mongolian or Chinese) text content, which greatly shortens the time required for translation, improves the overall translation efficiency, and can promptly meet the needs of different language texts in the rapid development of power business. Finally, the constructed Chinese parallel prediction library, Mongolian parallel corpus, and the generated hypergraph network and semantic mapping relationship are reusable resources. When encountering new power industry texts that need to be translated between Chinese and Mongolian in the future, there is no need to re-build translation rules and find corresponding vocabulary from scratch. The translation task can be quickly completed by directly calling these existing resources. For example, when new power technology is introduced into Inner Mongolia, it is necessary to translate the relevant Chinese technical information into Mongolian for promotion and training. By using the perfect resource system established by this solution, the translation work can be completed efficiently and accurately, avoiding the tedious steps of re-sorting terms and establishing corresponding relationships every time the translation is performed, and further improving the efficiency of translation work in long-term and large-scale business scenarios. Moreover, in the process of carrying out power business, accurate and clear information transmission is crucial. Whether it is the collaboration and communication between employees of different language backgrounds within the power company, or the promotion of services and popularization of knowledge on safe electricity use for power users in Mongolian-populated areas, accurate translation between Chinese and Mongolian can ensure that the information is not distorted and does not cause ambiguity. For example, when power maintenance personnel explain the troubleshooting methods of household power lines to Mongolian users, if the relevant Chinese maintenance guide can be accurately translated into Mongolian, users can better understand and follow the instructions to avoid misunderstandings caused by language barriers, thereby improving the quality of power services and ensuring the smooth development of power business at the end-user level. For the business expansion of the power industry in Mongolian-speaking areas such as Inner Mongolia, a large number of project bidding documents, technical cooperation agreements and other materials need to be accurately converted between Chinese and Mongolian so that partners with different language backgrounds can deeply understand the terms and conduct fair and just cooperation negotiations. The efficient and accurate Chinese-Mongolian translation method provided by the disclosed scheme can break the important language barrier, allowing power companies in Mongolian-speaking areas to cooperate more conveniently with local companies, government departments and other relevant institutions, attract more resources to be invested in power infrastructure construction, new energy project development and other businesses, thereby promoting the vigorous development of the entire power industry in relevant areas and providing strong support for regional economic construction and energy security.
[0007] Optionally, the construction of the Chinese parallel prediction library and Mongolian parallel corpus of the electric power industry terminology includes: obtaining Chinese subject description text and Mongolian subject description text of the electric power industry; performing text cleaning on the Chinese subject description text and Mongolian subject description text of the electric power industry to obtain Chinese main text and Mongolian main text; and constructing the Chinese parallel prediction library and Mongolian parallel corpus based on the Chinese main text and Mongolian main text. To this end, the specific technical processing process of constructing the Chinese parallel prediction library and Mongolian parallel corpus of the electric power industry terminology has the following technical benefits: (1) By obtaining the Chinese subject description text and Mongolian subject description text of the electric power industry as the original material for constructing the corpus, it can ensure that the collected data is closely related to the electric power industry. The electric power industry has many professional fields, such as power generation, transmission, substation, distribution, power equipment manufacturing, power system operation and maintenance, etc. Each field has its own exclusive terms, concepts and business process descriptions. Taking these topic description texts as the starting point is like accurately "fishing out" the key content for building the corpus in the rich ocean of power knowledge, so that the Chinese parallel corpus and Mongolian parallel corpus constructed later are naturally professional, focusing on the Chinese-Mongolian translation needs of the power industry, avoiding the mixing of a large amount of irrelevant general text information, and thus laying a professional foundation for the accurate translation of power industry terms. For example, when building a corpus about transmission line-related terms, the Chinese topic description text we obtained may contain content such as "the selection of conductors for overhead transmission lines must consider factors such as current carrying capacity and mechanical strength", and the corresponding Mongolian topic description text will have corresponding professional expressions. These texts can accurately reflect the professional knowledge and corresponding language expressions in the field of transmission lines, and thus provide strong support for the accurate translation of terms in this field. (2) The topic description texts of the power industry can come from multiple channels, such as technical documents, operation manuals, project reports within power companies, standards and specifications issued by industry associations, research results, and academic works on power professional fields by relevant universities and research institutions. Collecting texts from these different channels greatly enriches the content diversity of the corpus. Texts from different sources may have certain differences in the use of terminology and expression methods. Integrating these contents can more comprehensively cover various possible terms and their contexts in the power industry, so that the parallel corpus finally constructed can meet the translation needs in various actual business scenarios. For example, the technical documents within the power company may use some abbreviated terms that are commonly agreed upon within the company, while the standards and specifications of the industry association tend to be more unified and standardized in terms of terminology. The integration of these texts with different styles but all centered on the power industry can make the corpus better adapt to the Chinese-Mongolian translation tasks in different situations and improve the practicality and applicability of the corpus. (3) Text cleaning of the Chinese and Mongolian topic description texts of the power industry can effectively remove the noise information therein.The texts actually collected may contain some format errors, spelling errors, extra punctuation marks, repeated content, and redundant information that is not strongly related to the power industry. For example, in an article on power technology obtained from the Internet, there may be web page advertising code snippets, some irrelevant comments, or garbled characters due to typesetting problems. Through text cleaning, these impurities that affect the subsequent corpus construction and translation accuracy are removed, and pure Chinese main text and Mongolian main text are obtained, so that each piece of data in the constructed parallel corpus is high-quality, closely related to the power industry, and has a standardized format, providing a reliable data foundation for subsequent operations such as accurate term mining and establishing corresponding relationships. (4) The text cleaning process can also standardize the format of the text, such as standardizing fonts, font sizes, paragraph formats, and standardizing the use of punctuation marks. For Mongolian texts, it is also possible to standardize the format of its spelling, lexical structure, etc. to ensure that texts from different sources remain consistent in format. In this way, when constructing parallel corpora based on these main texts and performing subsequent text analysis, term mining, and hypergraph network generation, it can be smoother and more efficient, avoiding processing errors or additional format conversion work caused by format differences, and improving the efficiency and accuracy of the entire implementation process of the Chinese-Mongolian translation method. (5) Based on the cleaned Chinese main text and Mongolian main text, the Chinese parallel corpus and Mongolian parallel corpus are respectively constructed, which can ensure that the corpus is highly consistent with the actual Chinese-Mongolian translation needs of the power industry. Because the cleaned text has removed irrelevant information and only retains the most core part that best reflects the professional content of the power industry, the corpus constructed on this basis is more accurate in content composition. Every term and every description in it is centered on the power industry and has been screened and sorted, which can better serve the subsequent steps of generating hypergraph networks and establishing bidirectional semantic mapping relationships, ensuring that the final Chinese-Mongolian translation reaches a high level in accuracy and professionalism, and accurately meets the requirements of text conversion in different languages in power business transactions. (6) The constructed parallel corpus is an important basic link in the entire Sino-Mongolian translation method, providing an accurate and reliable data source for subsequent operations such as generating Chinese hypergraph networks and Mongolian hypergraph networks for power industry terms based on it, as well as performing bidirectional semantic associations. If the corpus construction is not accurate enough and the data quality is poor, then even if the most advanced artificial intelligence algorithms and technical means are used in the subsequent links, it will be difficult to achieve high-quality Sino-Mongolian translation results. The above-mentioned rigorous acquisition, cleaning, and construction process ensures the high quality of the parallel corpus, just like laying a solid "foundation" for the entire Sino-Mongolian translation "building", ensuring that the subsequent processes can be carried out smoothly and achieve the expected accurate and efficient translation goals, promoting the overall optimization of the power industry in Mongolian processing, and helping the power business to be better carried out in related regions.
[0008] To this end, the exemplary implementation code for constructing the Chinese parallel corpus and the Mongolian parallel corpus of power industry terminology is as follows:
[0009] importre
[0010] importos
[0011] 2. Obtain Chinese and Mongolian topic description texts for the power industry
[0012] In the following code examples, Chinese text files are stored in the `chinese_texts` folder, and Mongolian text files are stored in the `mongolian_texts` folder. Each file represents a topic description text. You can modify it according to the actual file storage method and path.
[0013]
[0014] 3. Perform text cleaning on the Chinese and Mongolian subject description texts of the power industry to obtain the Chinese and Mongolian main texts.
[0015]
[0016] 4. Based on the Chinese main text and the Mongolian main text, build the Chinese parallel corpus and the Mongolian parallel corpus respectively
[0017]
[0018] 5. Main function call
[0019]
[0020] In the above exemplary code, firstly, the `get_texts` function is used to read the contents of the Chinese and Mongolian power industry subject description text files from the specified folder, and collect them into corresponding lists respectively. Then, the `clean_text` function is used to clean the obtained Chinese and Mongolian text lists respectively, remove unnecessary spaces, specific special characters, etc., and obtain the cleaned text lists. Finally, the `build_corpora` function is used to further process the cleaned Chinese and Mongolian texts, split the text content by words, and construct them into Chinese parallel corpora and Mongolian parallel corpora respectively, and some sample contents of the constructed corpora can be viewed in the main function.
[0021] Optionally, the process of constructing the Chinese parallel prediction library and the Mongolian parallel corpus based on the Chinese main text and the Mongolian main text, respectively, includes: performing word segmentation processing on the Chinese main text and the Mongolian main text, respectively, to obtain Chinese word segmentation and Mongolian word segmentation; performing grammatical and syntactic analysis on the Chinese main text and the Mongolian main text, respectively, to obtain Chinese grammatical description and syntactic description, and Mongolian grammatical description and syntactic description; forming a Chinese word sequence based on the Chinese word segmentation, Chinese grammatical description and syntactic description to generate the Chinese parallel prediction library; forming a Mongolian word sequence based on the Mongolian word segmentation, Mongolian grammatical description and syntactic description to generate the Mongolian parallel prediction library. To this end, the process of constructing the Chinese parallel prediction library and the Mongolian parallel corpus based on the Chinese main text and the Mongolian main text, respectively, has the following technical benefits: (1) performing word segmentation processing on the Chinese main text and the Mongolian main text, respectively, and splitting the continuous text stream into independent Chinese word segmentation and Mongolian word segmentation, can make the basic semantic units of the text clearer. In Chinese, for professional terms such as "power transformer", by segmenting them into "power" and "transformer", the meaning of each part can be more clearly expressed, which is convenient for subsequent analysis of its specific usage in different contexts and its collocation relationship with other words. Similarly, for Mongolian texts, such as "трансформаторынхθлгθн(winding of transformer)", after segmentation, key semantic elements such as "трансформатор(transformer)" and "хθлгθн(winding)" can be clearly distinguished. This refinement helps to accurately grasp the composition and meaning of power industry terms in the text, lays the foundation for accurate construction of the corpus and subsequent translation work, and avoids translation errors due to fuzzy understanding of the overall text. (2) After segmentation, Chinese and Mongolian segmentation can be more conveniently managed and matched. In the power industry, there are often a large number of fixed collocation terms and combination words. After the text is segmented, the same words can be classified and sorted, and the index relationship between the words can be established. For example, when constructing a Chinese parallel corpus, all text fragments related to the word "power transmission" can be searched and associated more conveniently, and can be matched to Mongolian words with the same or similar semantics after word segmentation in the Mongolian text, so as to more efficiently sort out the corresponding relationship between Chinese and Mongolian terms, which helps to improve the accuracy and completeness of corpus construction, and further serve the subsequent Chinese-Mongolian translation process, so that the translator can accurately find the corresponding vocabulary expression. (3) Perform grammatical and syntactic analysis on the Chinese main text and the Mongolian main text respectively, and obtain the grammatical description and syntactic description of Chinese and the grammatical description and syntactic description of Mongolian, which enables us to go deep into the structural level of the text to understand its meaning. In the text of the power industry, the grammatical and syntactic structure of the sentence often carries important professional information and logical relationships.For example, for the Chinese sentence "Control the output voltage by adjusting the tap changer of the transformer", grammatical analysis can clarify the part of speech and grammatical functions of each component ("by...to..." indicates a structure of means and purpose), and syntactic analysis can parse out the structural relationships such as the subject, predicate, and object of the sentence, thereby understanding its internal logic. Similarly, Mongolian sentences also have their own specific grammar and syntactic rules, and through analysis, their accurate meaning can be grasped. When performing Chinese-Mongolian mutual translation, based on these grammar and syntactic descriptions, the structure and logic of the source language text can be accurately transferred to the target language, avoiding problems such as the translation not conforming to the expression habits of the target language and illogicality, and significantly improving the quality of translation. (4) Constructing a parallel corpus based on the results of grammar and syntactic analysis can enable the corpus to better reflect the language laws in the application of Chinese and Mongolian in the power industry. Different grammatical structures and syntactic forms correspond to different expressions in the two languages. Incorporating these laws into the construction of the corpus can make the corpus not just a simple collection of words, but a knowledge system containing the internal logic and structural relationships of the language. For example, in Chinese, the structure "……的……" is often used to express the possessive relationship, and Mongolian has a corresponding grammatical structure to express the same meaning. Considering this grammar and syntax correspondence when constructing the corpus can make the corpus more in line with the actual language usage when it is subsequently used for operations such as generating hypergraph networks and establishing semantic mapping relationships, providing strong support for achieving accurate and efficient Chinese-Mongolian mutual translation. (5) Generating a Chinese parallel corpus by forming a Chinese word sequence based on Chinese word segmentation, Chinese grammar description, and syntactic description, and generating a Mongolian parallel corpus by forming a Mongolian word sequence based on Mongolian word segmentation, Mongolian grammar description, and syntactic description. This method can organize the originally scattered text information in an orderly manner. Constructing the corpus in the form of a word sequence is like building a clear "index directory" for the corpus. When it is necessary to search for specific power industry terms, analyze their usage in different contexts, or match them with corresponding Mongolian words later, relevant content can be quickly located in the orderly word sequence, improving the retrieval efficiency and practicality of the corpus, facilitating the full utilization of the corpus data by the entire Chinese-Mongolian mutual translation system, and accelerating the data query and matching speed during translation. (6) When using artificial intelligence for Chinese-Mongolian mutual translation of power industry terms, a corpus in the form of an orderly word sequence is more in line with the requirements of model training and algorithm application. Artificial intelligence algorithms often require structured and standardized data input. By forming such a word sequence, the algorithm can better learn the semantic associations, grammatical correspondences, and syntactic conversion relationships between Chinese and Mongolian power industry terms.For example, when conducting semantic mapping learning based on deep learning, standardized word sequences help the model accurately capture features such as the order and collocation patterns of words, and then more accurately establish a two-way semantic mapping relationship between Chinese and Mongolian words, ultimately improving the accuracy and reliability of the entire Chinese-Mongolian translation method in practical applications, and ensuring that the power text content can be accurately converted between the two languages.
[0022] The following is an exemplary implementation code to implement the above steps of building a Chinese parallel corpus and a Mongolian parallel corpus:
[0023] 1. Import necessary libraries
[0024] Here we use the `jieba` library for Chinese word segmentation (a commonly used library for Chinese natural language processing). For Mongolian, we can use the `pymorphy2` library to assist in basic operations such as lexical analysis, and use the `nltk` library to assist in grammar and syntax analysis.
[0025] importjieba
[0026] importpymorphy2
[0027] fromnltkimportpos_tag,RegexpParser
[0028] importre
[0029] 2. Word segmentation, grammar and syntax analysis of Chinese text and construction of Chinese parallel prediction library
[0030] 2.1 Chinese word segmentation function
[0031] defchinese_word_segmentation(text):
[0032] words = jieba.cut(text)
[0033] return "".join(words).split()
[0034] 2.2 Chinese grammar and syntax analysis functions
[0035] defchinese_grammar_and_syntax_analysis(text):
[0036] Part-of-speech tagging
[0037] tagged_words=pos_tag(text.split())
[0038] Constructing parsing rules
[0039] grammar="NP:{ ? <jj> * <nn>}"
[0040] cp = RegexpParser (grammar)
[0041] result=cp.parse(tagged_words)
[0042] returntagged_words,result
[0043] 2.3 Constructing Chinese parallel prediction library functions
[0044]
[0045] 3. Word segmentation, grammar and syntax analysis of Mongolian texts and construction of a Mongolian parallel corpus
[0046] 3.1 Mongolian word segmentation function
[0047] defmongolian_word_segmentation(text):
[0048] returntext.split()
[0049] 3.2 Mongolian grammar and syntax analysis functions
[0050]
[0051] 3.2 Constructing Mongolian Parallel Corpus Function
[0052]
[0053] 4. Main function call
[0054]
[0055] Optionally, the forming of a Chinese word sequence based on the Chinese word segmentation, the Chinese grammatical description and the syntactic description to generate the Chinese parallel prediction library includes: arranging the Chinese word segmentations in order based on the order of the Chinese word segmentations in the Chinese topic description text to obtain a Chinese word linear sequence; determining the part-of-speech tags in the Chinese grammatical analysis results and adding them to the Chinese word linear sequence to obtain a Chinese part-of-speech injection sequence; adjusting the syntactic components of the Chinese part-of-speech injection sequence based on the Chinese syntactic analysis results to generate a Chinese word sequence and generate the Chinese parallel prediction library accordingly. The method comprises the steps of: forming a Mongolian word sequence based on the Mongolian word segmentation, Mongolian grammatical description and Mongolian syntactic description to generate the Mongolian parallel prediction library, comprising: arranging the Mongolian word segmentation in order based on the order of the Mongolian word segmentation in the Mongolian subject description text to obtain a Mongolian word linear sequence; determining the part-of-speech tag in the Mongolian grammatical analysis result and adding it to the Mongolian word linear sequence to obtain a Mongolian part-of-speech injection sequence; and adjusting the syntactic components of the Mongolian part-of-speech injection sequence based on the Mongolian syntactic analysis result to generate a Mongolian word sequence and generate the Mongolian parallel prediction library accordingly.
[0056] To this end, the above steps work closely together to optimize the construction of the Chinese and Mongolian parallel corpora in many aspects, from word order, part-of-speech tagging to syntactic structure adjustment, which has the following technical benefits:
[0057] 1. Preserve the original logical order of the text: Based on the order of Chinese word segmentation in the Chinese topic description text, the Chinese word segmentation is arranged in order to obtain a linear sequence of Chinese words. This can preserve the original narrative logic and semantic coherence of the text to the greatest extent. In the text of the power industry, the arrangement order of various terms and common words often contains important professional information and business logic. For example, in the text such as "first start the generator, then adjust the output voltage, and finally connect to the transmission line", the word segmentation is arranged in order as "generator", "start", "adjust", "output voltage", "connect", "transmission line" to form a linear sequence, which faithfully reflects the order of the power operation process. It is helpful to accurately understand the logical relationship of the content related to the power business when manually viewing the corpus or using artificial intelligence algorithms to learn text features, avoid semantic confusion caused by disrupting the order, and lay the foundation for accurate Chinese-Mongolian translation and power business communication. 2. Facilitate subsequent association and integration operations: With the linear sequence of Chinese words arranged in order, it is convenient to associate and integrate with the results obtained in other text processing links. For example, when you need to compare the descriptions of similar operating procedures in different texts, find the location and usage of specific power terms in multiple text contexts, etc., the unified linear sequence format makes these association and integration operations more intuitive and convenient. Moreover, when combined with the results of grammatical annotation and syntactic analysis, the corresponding annotation and analysis information can be added in sequence according to the order of words to construct a richer corpus content that accurately reflects the full picture of the text, thereby improving the systematicness and integrity of the corpus construction. 3. Enriching word semantic information: Determine the part-of-speech tagging in the grammatical analysis results of Chinese, and add it to the linear sequence of Chinese words to obtain the Chinese part-of-speech injection sequence. This operation can supplement the part-of-speech information of each word, further enriching the semantic connotation of the word. In the power industry, many words may have multiple parts of speech and meanings. Through clear part-of-speech tagging, their functions and meanings in specific contexts can be accurately distinguished. For example, the word "switch" can be a noun to indicate the "switch device" in power equipment, or a verb to indicate the action of "opening or closing". When it is marked as a noun " / n" (the assumed part-of-speech tagging method) in "check the high-voltage switch", and marked as a verb " / v" in "switch the power supply on and off as required", it can make the subsequent corpus-based translation, semantic understanding and other operations more accurately grasp its meaning, which helps to improve the accuracy of translation and avoid understanding and translation errors caused by confusion about parts of speech. 4. Assist language learning and matching at the grammatical level: For AI-based mutual translation methods, the word sequence after part-of-speech tagging helps the model better learn the language rules of Chinese at the grammatical level. Incorporating part-of-speech information when constructing a Chinese parallel prediction library allows the AI algorithm to find rules and matching patterns from the perspective of part-of-speech when analyzing the correspondence between Chinese and Mongolian texts.For example, nouns and nouns, verbs and verbs often have relatively fixed corresponding translation and conversion methods in different languages. The part-of-speech injection sequence can provide clear grammatical clues for the algorithm, so as to more accurately establish the semantic mapping relationship between Chinese and Mongolian, and improve the processing ability of the entire Chinese-Mongolian translation system for texts with different grammatical structures. 5. Optimize text structure representation: Based on the results of Chinese syntactic analysis, the syntactic components of the Chinese part-of-speech injection sequence are adjusted to generate a Chinese word sequence, which can optimize and integrate the text according to its inherent syntactic structure, so that the text in the corpus presents a structural form that is more in line with the actual use of the language. In the complex technical documents, operating instructions and other texts in the power industry, the syntactic structure of the sentence carries the key professional logic. For example, in the sentence "By adjusting the transformer's tap switch, the output voltage can be changed", after syntactic analysis, the structure of "through..., can..." that expresses conditions and results is clearly reflected in the word sequence. The adjusted word sequence can accurately reflect the hierarchical relationship and logical connection between the various components of the sentence, which is convenient for accurately understanding and translating the overall meaning of the sentence. It also allows the corpus to present content in a more structured and easier to understand way when storing and providing text information, making it convenient to use the corpus for various text processing and translation tasks in the future. 6. Improve the accuracy and fluency of mutual translation: From the perspective of mutual translation, the Chinese word sequence after the syntactic component adjustment helps to better convert the Chinese text into Mongolian according to the syntactic habits of the target language (Mongolian). The syntactic structures of different languages are different, and the word order and collocation relationship need to be accurately adjusted during the translation process. By considering the syntactic structure and making corresponding adjustments at the corpus construction stage, artificial intelligence can more specifically master how to reasonably convert texts that conform to Chinese syntax into texts that conform to Mongolian syntax when learning the Chinese-Mongolian translation model, ensuring that the translation is not only semantically accurate, but also fluent and natural in language expression, and conforms to the language habits of Mongolian, thereby improving the quality and effect of the entire Chinese-Mongolian translation and better serving the business communication needs of the power industry. 7. The linear sequence of Mongolian words can retain the logical order of its business content according to the original order of the Mongolian subject description text, which is crucial for accurately conveying relevant information about the power industry in the Mongolian context, such as Mongolian power technology operation procedures, equipment principle introductions, etc., and ensures the semantic coherence of the Mongolian text itself and in the translation process with Chinese. The Mongolian part-of-speech injection sequence can also clearly distinguish the grammatical function and meaning of Mongolian words in a specific context by adding part-of-speech tags. Mongolian also has multiple parts of a word. Part-of-speech tagging helps to accurately understand the content of Mongolian texts, and helps artificial intelligence to more reasonably find translation matches between Chinese and Mongolian based on the correspondence between parts of speech when translating between Chinese and Mongolian, thereby improving the accuracy of translation.The Mongolian word sequence generated by adjusting the results of Mongolian syntactic analysis optimizes the structural representation of Mongolian text in the corpus, making it more in line with Mongolian language habits and syntactic rules, and facilitating accurate conversion according to the syntactic structure of Mongolian when translating Chinese into Mongolian and vice versa, making the translation more fluent and natural, avoiding problems such as stiff translation and unclear meaning caused by syntactic differences, and improving the quality of the entire Sino-Mongolian translation in Mongolian processing and its adaptability to power business applications.
[0058] The following is an exemplary code for the steps of building the Chinese parallel corpus and the Mongolian parallel corpus:
[0059] 1. Import necessary libraries
[0060] importjieba
[0061] fromnltkimportpos_tag,RegexpParser
[0062] importpymorphy2
[0063] 2. Constructing Chinese parallel prediction library related functions
[0064] 2.1 Generate Chinese word linear sequence function
[0065] defget_chinese_word_linear_sequence(text):
[0066] words = jieba.cut(text)
[0067] returnlist(words)
[0068] 2.2 Generate Chinese part-of-speech injection sequence function
[0069]
[0070] 2.3 Generate Chinese word sequences based on syntactic analysis and build Chinese parallel prediction library functions
[0071]
[0072] 3. Constructing Mongolian parallel corpus related functions
[0073] 3.1 Generate Mongolian word linear sequence function
[0074] defget_mongolian_word_linear_sequence(text):
[0075] returntext.split()
[0076] 3.2 Generate Mongolian part-of-speech injection sequence function
[0077]
[0078] 3.3 Generate Mongolian word sequences based on syntactic analysis and construct Mongolian parallel corpus function
[0079]
[0080] 4. Main function call
[0081]
[0082] In the above code, the `get_chinese_word_linear_sequence` function uses the `jieba` library to segment the input Chinese text and returns a linear sequence of Chinese words in order. The `get_chinese_pos_injected_sequence` function uses the `pos_tag` function of the `nltk` library to perform part-of-speech tagging based on the linear sequence of words, and adds the tag information to the back of the words in sequence to form a part-of-speech injection sequence. The `build_chinese_corpus_with_syntax` function first completes the first two steps, then uses the `nltk` library to build a simple syntactic analysis rule to perform syntactic analysis on the words corresponding to the part-of-speech injection sequence, and then adjusts the sequence based on the analysis results, and finally adds the adjusted sequence content to the corpus list, and finally returns the constructed Chinese parallel prediction library.
[0083] The `get_mongolian_word_linear_sequence` function divides Mongolian text into a linear sequence of words. In practical applications, Mongolian word segmentation requires the use of professional Mongolian word segmentation tools for more accurate processing. The `get_mongolian_pos_injected_sequence` function uses the `pymorphy2` library to perform lexical analysis on Mongolian words to obtain part-of-speech tags, and adds them to the linear sequence of words to form a part-of-speech injection sequence. The processing flow of the `build_mongolian_corpus_with_syntax` function is similar to that of the Chinese part. First, the linear sequence of words and the part-of-speech injection sequence are obtained, and then syntactic analysis and corresponding adjustments are performed.
[0084] Optionally, the generation of a Chinese hypergraph network of electric power industry terms based on the Chinese parallel prediction library includes: performing dependency annotation on Chinese feature words in the Chinese parallel prediction library to obtain a Chinese word dependency tree; based on the Chinese word dependency tree, determining the mapping nodes and mapping hyperedges projected to the Chinese hypergraph network to generate the Chinese hypergraph network. To this end, the specific technical processing process of generating a Chinese hypergraph network of electric power industry terms based on the Chinese parallel prediction library has the following technical benefits: 1. Revealing the intrinsic semantic association of words: performing dependency annotation on Chinese feature words in the Chinese parallel prediction library to obtain a Chinese word dependency tree, which can clearly show the deep semantic connection between electric power industry terms and related words. In the electric power industry text, each word does not exist in isolation, but has a complex dependency structure. For example, in the sentence "The transformer realizes voltage conversion through the principle of electromagnetic induction", "transformer" and "electromagnetic induction principle" have a dependency relationship based on function realization, and "voltage conversion" is the result of the action of "transformer". Through dependency annotation and construction into a dependency tree, this intrinsic semantic association can be intuitively presented. This helps to understand the meaning of the power industry text more deeply, and to dig out the collocation and constraint relationship between terms and other words in different contexts, providing a precise semantic basis for the subsequent construction of hypergraph networks and accurate Chinese-Mongolian translation. 2. Help sort out the grammatical structure of the text; the dependency tree also reflects the grammatical structure characteristics of the text. Words of different parts of speech play different grammatical roles in sentences and depend on each other to form specific structures. Taking "the generator set in the power system is responsible for providing electric energy" as an example, through dependency annotation, it can be clarified that "the generator set" is the executor of the action of "providing" (subject-predicate relationship), and "electric energy" is the object of "providing" (verb-object relationship). This structural information sorted out from a grammatical perspective is very important for accurately grasping the composition and meaning of power industry sentences, especially when dealing with long sentences with complex structures and containing multiple power professional terms. It can help to clearly analyze the relationship between the various parts of the sentence, avoid translation errors or semantic misunderstandings caused by unclear grammatical understanding, and further improve the accuracy of the entire Chinese-Mongolian translation process. 3. Integrate diverse text information: Since the Chinese parallel prediction database brings together Chinese topic description texts from multiple channels and types of power industry, these texts may differ in expression style, word usage habits, etc. By generating a dependency tree through dependency annotation, these diverse text information can be integrated in a unified semantic and grammatical association manner.Whether the text is from an internal report of a power enterprise, an industry standard document, or an academic work, as long as it involves the same or similar terms and concepts in the power industry, its common and individual semantic and grammatical relationships can be sorted out under the framework of the dependency tree, so that the Chinese hypergraph network constructed based on these relationships can comprehensively and comprehensively cover various situations of Chinese expressions in the power industry, and enhance the processing capabilities of the corpus and the entire translation system for different text contents. 4. Efficient representation of complex semantic relationships: Based on the Chinese word dependency tree, the mapping nodes and mapping hyperedges projected to the Chinese hypergraph network can be determined, which can represent the complex semantic relationships between power industry terms in an efficient and flexible way. Compared with ordinary graphs, hypergraphs can connect multiple nodes with their hyperedges, which are more suitable for describing complex many-to-many dependencies between words. For example, in a text involving power system fault diagnosis, "short circuit fault" may have a causal relationship with multiple factors such as "line aging", "overload operation", and "protection device failure". In the hypergraph network, these terms can be represented by appropriate mapping nodes, and the complex relationships between them can be accurately reflected by mapping hyperedges. Compared with the traditional linear structure or simple graph structure, this representation method can present the association network between terms in the knowledge system of the power industry in a more comprehensive and three-dimensional way, which helps artificial intelligence algorithms to better learn and grasp these relationships, so that when translating between Chinese and Mongolian, they can accurately find the corresponding Mongolian expressions based on the complete semantic associations, thereby improving the accuracy and completeness of the translation. 5. Enhance semantic reasoning ability; once the Chinese hypergraph network is successfully constructed, the network structure composed of its nodes and hyperedges gives the system stronger semantic reasoning ability. When encountering a new Chinese text fragment in the power industry for translation, the system can infer the unknown semantic associations or fill in the missing information based on the connection relationship (hyperedge) between nodes (terms) in the existing hypergraph network. For example, in a Chinese text describing the maintenance of power equipment, it is mentioned that a certain equipment has an abnormality, but it does not clearly indicate which specific factors are related. Through the semantic connection between other similar equipment abnormalities and related influencing factors in the hypergraph network, reasonable reasoning can be performed to assist in translating Mongolian content that is more logical and realistic. This semantic reasoning capability is very helpful for dealing with texts that are not fully matched in the prediction library but are semantically related, further expanding the scope and effect of the Chinese-Mongolian translation system on the processing of diversified texts in the power industry. 6. Facilitate semantic mapping and knowledge transfer: In the overall process of Chinese-Mongolian translation, the generated Chinese hypergraph network can be used as an important intermediate structure to facilitate alignment with the Mongolian hypergraph network and establish a bidirectional semantic mapping relationship. Since the hypergraph network clearly shows the semantic structure of Chinese power industry terminology, when it is associated with the Mongolian hypergraph network, it is possible to more accurately find semantically equivalent or similar nodes (terms) and corresponding semantic relationships (hyperedges) in the two languages to achieve effective semantic mapping.Moreover, this mapping relationship can also promote the transfer of knowledge between the two languages. For example, the detailed description of a certain advanced power technology in the Chinese text can be accurately converted into Mongolian expression with the help of semantic mapping between hypergraph networks, so that Mongolian speakers can fully understand and apply relevant technical knowledge, and promote the smooth development of technical exchanges and business development in the power industry in the Sino-Mongolian language environment.
[0085] To this end, based on the Chinese parallel forecast library, a specific technical process of generating a Chinese hypergraph network of electric power industry terms is described. The exemplary code is as follows:
[0086] 1. Import necessary libraries
[0087] importspacy
[0088] importnetworkxasnx
[0089] 2. Dependency annotation and generation of Chinese word dependency tree function
[0090]
[0091] The purpose of this function is to traverse each text in the Chinese parallel prediction library, process the text using the Chinese language model loaded by the `spacy` library, obtain the text content of each word, its dependencies, and the index of the dependent words, organize this information into a tree structure in the form of a list, and finally return a list of dependency trees corresponding to all texts.
[0092] 3. Determine the mapping nodes and mapping hyperedges based on the dependency tree and generate Chinese hypergraph network functions
[0093]
[0094] This function receives the previously generated Chinese word dependency tree list as a parameter, traverses the word information in each dependency tree, and adds the word as a node to the graph (simulated hypergraph). If the word has other dependent words (determined by the dependency word index), an edge is added between it and the dependent words, and finally the constructed hypergraph network structure is returned (here the graph structure of `networkx` is used to facilitate subsequent visualization and other operations. If strict hypergraph operations are required in actual applications, they can be replaced with corresponding hypergraph processing libraries).
[0095] 4. Main function call (Chinese parallel prediction library `chinese_corpus`)
[0096]
[0097] In the above code:
[0098] The Chinese language model of the `spacy` library is used to process each text in the Chinese parallel prediction library, and the dependency relationship and other information of the words are obtained to construct a dependency tree. This tree structure helps to sort out the grammatical and semantic dependencies between words in the text, and provides a basis for the subsequent hypergraph network construction. Based on the words and their dependencies in the dependency tree, the words are added as nodes to the simulated hypergraph, and the dependency connection relationship between words is reflected by adding edges (simulated hyperedges). In this way, a hypergraph network structure that can represent the complex semantic associations between terms in the power industry is constructed, which is convenient for subsequent semantic mapping, reasoning and other operations in the Chinese-Mongolian translation process, and helps improve the accuracy and quality of translation. The result format of the dependency annotation by the `spacy` library can be further optimized and adjusted according to actual needs to make it more suitable for the characteristics of the power industry text and the requirements of subsequent processing steps.
[0099] Optionally, the dependency annotation of the Chinese feature words in the Chinese parallel prediction library to obtain a Chinese word dependency tree includes: vectorizing the Chinese professional terminology dictionary of the electric power industry to obtain a standard word vector of the Chinese professional terminology of the electric power industry; vectorizing the Chinese expanded terminology of the electric power industry to obtain an expanded word vector of the Chinese professional terminology of the electric power industry; clustering analysis of the standard word vector of the Chinese professional terminology of the electric power industry and the expanded word vector of the Chinese professional terminology of the electric power industry to obtain cluster center vectors under different semantic categories; based on the cluster center vectors under the different semantic categories, the dependency annotation of the Chinese feature words in the Chinese parallel prediction library is performed to obtain a Chinese word dependency tree. To this end, the above-mentioned specific technical processing process of performing dependency annotation on the Chinese feature words in the Chinese parallel prediction library to obtain a Chinese word dependency tree has the following technical benefits:
[0100] 1. Unified semantic representation: vectorize the Chinese professional terminology dictionary of the power industry to obtain the standard word vector of the Chinese professional terminology of the power industry, which can represent various types of power professional terms in a unified numerical form that is easy for computer processing. In the power industry, there are a large number of terms with precise meanings but diverse expressions, such as "transformer" and "mutual inductor". Through vectorization, they are converted into numerical vectors with specific dimensions. This unified representation allows subsequent operations such as semantic comparison, cluster analysis, and dependency labeling to be based on consistent mathematical language, avoiding the ambiguity of semantic understanding and processing of text-based terms, and laying the foundation for accurate analysis of the relationship between power industry terms. 2. Mining potential semantic associations: word vectors can reflect the potential semantic associations between words to a certain extent. For example, in the vector space, the vector distances corresponding to semantically similar power industry terms (such as "high-voltage switchgear" and "low-voltage switchgear", which both belong to the switchgear category and have different voltage levels) are often close. By vectorizing the Chinese professional terminology dictionary of the power industry, we can use the distance, similarity and other metrics of the vectors to explore these potential semantic connections, which helps to more comprehensively sort out the internal relationships between different terms in the knowledge system of the power industry. This is very important for the subsequent accurate construction of the word dependency tree and the grasp of semantic accuracy in the entire Sino-Mongolian translation work, and can enable the translation system to better understand the subtle differences and correct usage of similar terms in different contexts. 3. Enriching semantic coverage: The Chinese amplified terms in the power industry usually include some vocabulary expressions that are derived from actual business applications or newly emerged but related to standard terms. Vectorizing these amplified terms to obtain the amplified word vectors of Chinese professional terminology in the power industry can further enrich the coverage of the entire power industry terminology at the semantic level. For example, with the development of power technology, some new types of power equipment or processes may have new names. Including these amplified terms in the scope of vectorization can make the constructed semantic space more in line with the actual situation of the continuous development and change of the power industry, ensuring that these newly emerging semantic information will not be missed in subsequent analysis and processing, so as to more comprehensively serve the accurate translation of various power text contents in the Sino-Mongolian translation process. 4. Enhance the adaptability of the terminology system: The vectorized augmented word vectors can participate in subsequent analysis operations together with the standard word vectors, making the entire Chinese terminology system in the power industry more adaptable when facing the constantly updated knowledge, concepts and expressions in the industry.For example, when new terms related to renewable energy generation are added to the discourse system of the power industry, their corresponding augmented word vectors can be integrated into the existing vector space, and can be interrelated and interacted with the term vectors in the traditional fields of power generation and transmission, so as to accurately determine their position in the entire semantic network of the power industry in the process of dependency annotation, thereby ensuring that the Chinese-Mongolian translation system built on this basis can handle the text content involving these new terms in a timely manner and keep up with the development of the power industry. 5. Summarize semantic categories and simplify semantic relationship combing: Cluster analysis is performed on the standard word vectors of Chinese professional terms in the power industry and the augmented word vectors of Chinese professional terms in the power industry to obtain the cluster center vectors under different semantic categories, which can summarize and classify the numerous and complex power industry terms according to semantic similarity. For example, all terms related to power generation equipment can be clustered into one category, and those related to transmission lines can be clustered into another category, etc. This classification method greatly simplifies the difficulty of subsequent sorting out the semantic relationship between terms, so that when constructing the Chinese word dependency tree, the dependency relationship between words can be grasped from a more macroscopic semantic category level, avoiding the dilemma of analyzing the complex relationship between a large number of individual terms one by one, and improving the efficiency and accuracy of the entire semantic relationship sorting and dependency annotation. 6. Highlight semantic commonalities and differences, and assist in accurate annotation: The different semantic categories and their cluster center vectors obtained by cluster analysis clearly show the semantic commonalities of terms in each category and the semantic differences between different categories. When the Chinese feature words in the Chinese parallel prediction library are annotated with dependencies based on the cluster center vectors, these commonalities and differences become important references. For example, terms in the same cluster category often have similar grammatical functions and dependent objects in sentences, while terms in different categories may have obvious hierarchical structures in terms of dependencies (such as power generation-related terms may be pre-dependent factors of transmission-related terms). With the help of the results of cluster analysis, the dependency relationship between each feature word and other words can be judged more accurately, and the dependency tree that conforms to the actual semantics and grammatical logic of the power industry text can be marked, thereby improving the accuracy of the source language text structure and semantic understanding during the Chinese-Mongolian translation process. 7. Optimize dependency annotation based on semantic categories: According to the cluster center vectors under different semantic categories, the Chinese feature words in the Chinese parallel prediction library are annotated with dependencies, which can make full use of the semantic information summarized by the previous clustering, making the dependency annotation more reasonable and accurate. Since the cluster center vector reflects the typical characteristics of a certain type of semantic category, during the annotation process, the feature word can more accurately determine its dependent object and dependency type in the sentence based on the semantic category to which it belongs and the similarity with the cluster center vector.For example, if a feature word is determined to belong to the semantic category of "power equipment fault diagnosis" (by comparing it with the corresponding cluster center vector), then when annotating the dependency relationship, we can more specifically find related fault phenomena, diagnostic methods and other words to establish dependency relationships, so that the dependency tree can better reflect the semantic structure of the power industry text in this field, and provide a high-quality semantic basis for the subsequent construction of hypergraph networks and Chinese-Mongolian translation. 8. Improve the adaptability of the dependency tree to the power industry text; the final Chinese word dependency tree, based on this dependency annotation method combined with the cluster center vector, will be more in line with the characteristics and logic of the power industry text itself. The texts in the power industry have unique usage habits of professional terminology, grammatical structures, and semantic association patterns. The dependency tree constructed through the above steps can accurately capture and present these characteristics. Whether it is describing the operating principles of the power system, equipment operating procedures, or fault handling and other types of text content, the dependency tree can clearly show the internal connections between the words, so that the subsequent Chinese hypergraph network generated based on the dependency tree and the entire Sino-Mongolian translation system can better meet actual business needs when processing power industry texts, improve the accuracy and fluency of translation, and effectively promote the business development of the power industry in the Sino-Mongolian language communication scenario.
[0101] To this end, the above-mentioned specific technical processing process of performing dependency annotation on the Chinese feature words in the Chinese parallel prediction library to obtain the Chinese word dependency tree is as follows:
[0102] Implement the above process of labeling the Chinese feature words in the Chinese parallel prediction library based on the relevant processing of Chinese terms in the power industry and obtaining the dependency tree. In this example, the `gensim` library is used for word vector training, the `sklearn` library is used for cluster analysis, and the `spacy` library is used to assist in dependency labeling (to obtain labeling results that are more consistent with grammatical and semantic logic).
[0103] 1. Import necessary libraries
[0104] importgensim
[0105] importnumpyasnp
[0106] fromsklearn.clusterimportKMeans
[0107] importspacy
[0108] 2. Vectorize the Chinese professional terminology dictionary for the power industry
[0109] defvectorize_standard_terms(term_file_path,vector_size=100,window=5,min_count=1,workers=4):
[0110] Vectorize the Chinese professional terminology dictionary for the power industry.
[0111] parameter:
[0112] term_file_path(str): The file path that stores the Chinese professional terminology dictionary for the power industry, with one term per line.
[0113] vector_size(int): The dimension size of the word vector, the default value is 100.
[0114] window(int): The window size for word vector training, the default value is 5.
[0115] min_count(int): Ignore words with a lower occurrence number than this value during word vector training. The default value is 1.
[0116] workers (int): The number of threads used when training word vectors. The default value is 4.
[0117] return:
[0118] dict: A dictionary with terms as keys and corresponding word vectors as values.
[0119] Reading term dictionary files
[0120] withopen(term_file_path,'r',encoding='utf-8')asf:
[0121] terms=[line.strip()forlineinf.readlines()]
[0122] Training the Word2Vec model
[0123] model=gensim.models.Word2Vec(sentences=[terms],vector_size=vector_size,window=window,min_count=min_count,workers=workers)
[0124] Get the word vector dictionary corresponding to the term
[0125] term_vectors={term:model.wv[term]fortermterms}
[0126] returnterm_vectors
[0127] 3. Vectorization of Chinese amplified terms in the power industry
[0128] defvectorize_augmented_terms(augmented_term_file_path,vector_size=100,window=5,min_count=1,workers=4):
[0129] Vectorize Chinese augmented terminology in the power industry.
[0130] parameter:
[0131] augmented_term_file_path(str): The file path storing the Chinese augmented terms for the power industry, one term per line.
[0132] vector_size(int): The dimension size of the word vector, the default value is 100.
[0133] window(int): The window size for word vector training, the default value is 5.
[0134] min_count(int): Ignore words with a lower occurrence number than this value during word vector training. The default value is 1.
[0135] workers (int): The number of threads used when training word vectors. The default value is 4.
[0136] return:
[0137] dict: A dictionary with augmented terms as keys and corresponding word vectors as values.
[0138] withopen(augmented_term_file_path,'r',encoding='utf-8')asf:
[0139] augmented_terms=[line.strip()forlineinf.readlines()]
[0140] Reuse the parameter settings of the Word2Vec model for training
[0141] model=gensim.models.Word2Vec(sentences=[augmented_terms],vector_size=vector_size,window=window,min_count=min_count,workers=workers)
[0142] augmented_term_vectors={term:model.wv[term]forterminaugmented_terms}
[0143] returnaugmented_term_vectors
[0144] 4. Cluster analysis of standard word vectors and augmented word vectors
[0145] defcluster_analysis(standard_term_vectors,augmented_term_vectors,n_clusters=5):
[0146] Cluster analysis is performed on the standard word vectors and augmented word vectors of Chinese professional terms in the power industry.
[0147] parameter:
[0148] standard_term_vectors(dict): Dictionary of standard word vectors for Chinese professional terms in the power industry.
[0149] augmented_term_vectors(dict): Dictionary of augmented term vectors for Chinese professional terms in the power industry.
[0150] n_clusters (int): The number of clustering categories, the default is 5.
[0151] return:
[0152]
[0153]
[0154] Clustering using KMeans algorithm
[0155] kmeans=KMeans(n_clusters=n_clusters,random_state=0).fit(all_vectors)
[0156] Get the cluster center vector
[0157] cluster_centers=kmeans.cluster_centers_
[0158] Constructing a dictionary of term clustering results
[0159]
[0160] 5. According to the cluster center vector, the Chinese feature words in the Chinese parallel prediction library are annotated with dependency relations to obtain the Chinese word dependency tree defannotate_dependency_relation(cluster_centers,term_clusters,chinese_corpus):
[0161] The Chinese feature words in the Chinese parallel prediction library are annotated with dependency relationships according to the cluster center vector to generate a Chinese word dependency tree.
[0162] parameter:
[0163] cluster_centers (numpy.ndarray): Cluster center vectors under different semantic categories.
[0164] term_clusters(dict): term clustering results, the key is the cluster category index, and the value is the term list.
[0165] chinese_corpus(list): Chinese parallel prediction library, containing multiple Chinese texts.
[0166] return:
[0167]
[0168] 6. Main function call (there are relevant file paths and Chinese parallel prediction library content)
[0169]
[0170] In the above code, the `vectorize_standard_terms` and `vectorize_augmented_terms` functions are used to vectorize the Chinese professional terminology dictionary and augmented terminology in the power industry, respectively. They read the corresponding text file content, use the `Word2Vec` model to train the word vector according to the set parameters (such as vector dimension, window size, etc.), and return the result in the form of a dictionary corresponding to the term and vector. In practical applications, the parameter settings of the `Word2Vec` model can be further optimized according to the characteristics of the power industry terminology and subsequent processing requirements, such as by experimenting with different vector sizes to find the dimension that best reflects the semantic difference of the term, or adjusting the window size to adapt to the common context range of the term in the text.
[0171] The `cluster_analysis` function combines the standard word vectors and augmented word vectors obtained above, and then uses the `KMeans` algorithm to perform clustering. The number of clusters is set by the parameter `n_clusters` (the default is 5 in the example, but it can be adjusted according to the level of sophistication required for semantic classification of power industry terms). The returned results include the cluster center vectors and a dictionary that classifies the terms according to the clustering results, so that the subsequent dependency annotation can be assisted based on these classification information.
[0172] The `annotate_dependency_relation` function is the key part of the whole process. It processes each text in the Chinese parallel prediction library with the help of the Chinese language model loaded by the `spacy` library. For each word in the text, first calculate its similarity with each cluster center vector, determine the most similar cluster category to which it belongs, and obtain the grammatical role of the word in the sentence (dependency type) and dependent words and other information. After integrating this information, it constructs the node information of the dependency tree, and finally represents the dependency tree of each text in the form of a dictionary, and returns a list containing all text dependency trees.
[0173] Optionally, based on the Chinese word dependency tree, determining the mapping nodes and mapping hyperedges projected to the Chinese hypergraph network to generate the Chinese hypergraph network includes: determining the word nodes in the Chinese word dependency tree, and performing semantic role annotation on the word nodes to determine the role of each word in the Chinese main text; mining the topic model in the Chinese word dependency tree according to the role of each word in the Chinese main text to obtain a Chinese power topic vector; based on the Chinese power topic vector, filtering out the nodes to be mapped and the corresponding semantic dependency representations from the Chinese word dependency tree; projecting the nodes to be mapped into the Chinese hypergraph network to form the mapping nodes, and projecting the semantic dependency representations into the Chinese hypergraph network to form mapping hyperedges to generate the Chinese hypergraph network. To this end, the detailed process of determining the mapping nodes and mapping hyperedges projected to the Chinese hypergraph network based on the Chinese word dependency tree to generate the Chinese hypergraph network has the following technical benefits: 1. Clarifying the function and status of words: Determining the word nodes in the Chinese word dependency tree and annotating them with semantic roles can accurately clarify the role of each word in the Chinese main text. In the power industry text, different words have different functions and importance. For example, in the sentence "The transformer in the power system is responsible for increasing the voltage", "transformer" is the core action executor role, "increasing the voltage" is the action it performs, and "power system" is the macro-environment category. Through semantic role annotation, this function and status in the sentence are clearly presented, which helps to deeply understand the semantic structure of the text, avoid vague cognition of the meaning and role of words, and lay the foundation for the subsequent construction of a hypergraph network that accurately reflects the knowledge relationship of the power industry. 2. Assisting cross-sentence and cross-text analysis: When processing a large amount of Chinese main text in the power industry, the word nodes with semantic role annotation are convenient for cross-sentence and cross-text analysis. Since annotation unifies the role measurement standards of words in different sentences and texts, we can more easily compare and analyze the usage and collocation relationships of words with similar roles in different contexts. For example, in multiple texts describing power equipment failures, by annotating word nodes with different semantic roles such as the cause of the failure and the phenomenon of the failure, we can summarize the commonalities and characteristics of common failures of different power equipment, and then enrich and improve the semantic information required for the subsequent construction of the hypergraph network, and enhance the hypergraph network's ability to represent the overall knowledge system of the power industry. 3. Extract macro-topic features; according to the role of each word in the Chinese main text, the topic model in the Chinese word dependency tree is mined to obtain the Chinese power topic vector. This step can extract macro-topic features from a large amount of scattered word information.The power industry involves many sub-sectors and complex business content. Through topic model mining, the features of different topic levels in the text, such as power generation, transmission, substation, and distribution, can be quantified in the form of vectors. For example, a group of texts around the theme of "transmission lines" can summarize the key elements such as common line structures, transmission parameters, and related equipment under the theme after topic model mining, so that the subsequent hypergraph network can integrate semantic relationships at the topic level when constructing, avoid falling into the processing of too many micro-word relationships, and improve the efficiency of hypergraph network construction and the overall grasp of the knowledge system of the power industry. 4. Capture the potential topic association of texts; topic vectors can capture the potential topic associations between different texts. Even if the texts differ in surface expression, as long as they involve the same or related power topics, the similarity of their topic vectors can be reflected. For example, a text introducing new transmission technology and another text on the optimization and transformation of transmission lines, although the words and specific descriptions are different, their relevance under the large theme of transmission can be found through topic vectors. This capture of potential topic associations helps to more reasonably connect semantic information from different text sources when constructing a hypergraph network, allowing the hypergraph network to more comprehensively cover all aspects of the power industry knowledge and the internal connections between them, and enhance the richness and completeness of the hypergraph network in semantic expression. 5. Focus on key semantic elements; based on the Chinese power theme vector, the nodes to be mapped and the corresponding semantic dependency representations are filtered out from the Chinese word dependency tree, which can focus on the semantic elements that are most critical to the construction of the hypergraph network. In a complex word dependency tree, not all word nodes and dependencies are equally important for reflecting the core knowledge of the power industry. By screening the topic vector, we can select those parts that are closely related to the power theme and can highlight the essential connection between power industry terms. For example, in a dependency tree corresponding to a power system operation text containing many descriptive words, key nodes such as "generator", "turbine", and "power output" and their dependencies are selected based on the topic vector, and the interference of some relatively minor modifying and general words is removed, so that the elements subsequently projected into the hypergraph network are the most able to reflect the substantive content of the power business, which helps to build a hypergraph network that expresses the semantics of the power industry in a concise and efficient manner. 6. Optimize the semantic structure of the hypergraph network; the screening process is actually an optimization of the semantic structure of the hypergraph network. It ensures that the mapping nodes and mapping hyperedges entering the hypergraph network are all around the power theme and conform to the knowledge logic of the power industry, avoiding the hypergraph network from becoming complex in structure and confusing in semantics due to too many redundant or irrelevant elements. The hypergraph network constructed in this way can play a more efficient and accurate role in operations such as semantic query, reasoning, and semantic mapping with the Mongolian hypergraph network, improving the overall performance of Chinese-Mongolian translation and power industry knowledge processing based on the hypergraph network.7. Build a flexible and powerful semantic network: Project the nodes to be mapped into the Chinese hypergraph network to form mapping nodes, and project the semantic dependency representation into the Chinese hypergraph network to form mapping hyperedges, so as to generate a Chinese hypergraph network, which can build a flexible and powerful semantic network to represent the knowledge of the power industry. The characteristics of the hypergraph network enable it to connect multiple nodes through hyperedges, which is very suitable for describing the many-to-many complex semantic relationships in the power industry. For example, "power failure" may have dependency relationships with multiple "equipment components", "operating parameters", "external environmental factors", etc. In the hypergraph network, this complex relationship can be accurately presented through appropriate mapping nodes and mapping hyperedges. Compared with traditional graph structures or linear structures, it is more suitable for the actual semantic scenarios of the power industry, and provides more effective data structure support for artificial intelligence in learning and processing the relationship between terms in the power industry. 8. Realize semantic integration and knowledge association; The Chinese hypergraph network generated by this projection method realizes the deep integration of semantics in the power industry text and the comprehensive association of knowledge. It integrates word nodes and their dependencies mined from different texts and different themes in a unified hypergraph network form, so that the knowledge of the power industry originally scattered in various texts can be gathered and interconnected. For example, the knowledge about power equipment manufacturing and the knowledge about power system operation and maintenance can be interconnected through nodes and hyperedges in the hypergraph network to form a complete knowledge graph of the power industry, which is not only convenient for accurately finding corresponding semantic expressions in Chinese-Mongolian translation, but also helps power industry personnel to systematically learn, understand and apply the entire industry knowledge system, and promote the in-depth development of power industry business and technical exchanges and inheritance.
[0174] The following is an exemplary code to illustrate how to determine the mapping nodes and mapping hyperedges projected to the Chinese hypergraph network based on the Chinese word dependency tree to generate the Chinese hypergraph network. In this example, `spacy` is used for dependency analysis and semantic role labeling (part of the functions are implemented with it), `gensim` is used for topic model mining, and the `networkx` library is used to build the hypergraph network.
[0175] 1. Import necessary libraries
[0176] importspacy
[0177] importgensim
[0178] importnetworkxasnx
[0179] importnumpyasnp
[0180] 2. Determine word nodes and perform semantic role labeling functions
[0181] defannotate_semantic_roles(dependency_trees):
[0182] Perform semantic role labeling on word nodes in Chinese word dependency trees.
[0183] parameter:
[0184] dependency_trees(list): A list containing dependency trees of Chinese words. Each dependency tree is represented in dictionary form, with the key being the word and the value being a dictionary containing dependency information.
[0185] return:
[0186]
[0187] This function receives a list of Chinese word dependency trees as parameters. For each tree, it first combines the words into text and analyzes them using the Chinese model of the `spacy` library. Then, it simply preliminarily determines the semantic role based on the word dependency type. Finally, it adds the semantic role annotation to the information dictionary corresponding to the word and returns the annotated dependency tree list.
[0188] 3. Obtain Chinese electricity topic vector function based on semantic role mining topic model
[0189] defextract_theme_vectors(annotated_trees):
[0190] The topic model is mined based on the dependency tree after annotating the semantic roles to obtain the Chinese electricity topic vector.
[0191] parameter:
[0192] annotated_trees(list): A list of Chinese word dependency trees annotated with semantic roles.
[0193] return:
[0194]
[0195] This function first reassembles the words in the dependency tree after annotating the semantic roles into a text list, then uses the `gensim` library to build a dictionary and corpus, and uses `LdaModel` to perform topic model mining (the number of topics is set to 5 in the example, which can be adjusted according to the degree of refinement of the power industry topic classification), converts the topic distribution corresponding to each text into a fixed-length vector form, and finally returns an array containing all text topic vectors.
[0196] 4. Filter the nodes to be mapped and the semantic dependency representation function based on the Chinese power theme vector
[0197] deffilter_nodes_and_relations(theme_vectors,annotated_trees):
[0198] According to the Chinese electricity topic vector, the nodes to be mapped and the semantic dependency representation are selected from the dependency tree after the semantic roles are annotated.
[0199] parameter:
[0200] theme_vectors(numpy.ndarray): Chinese electricity theme vector array.
[0201] annotated_trees(list): A list of Chinese word dependency trees annotated with semantic roles.
[0202] return:
[0203]
[0204] This function filters the dependency tree after each labeled semantic role based on the Chinese power topic vector. For the case where the weight in the topic vector is large (the threshold is set to 0.2 in the example and can be adjusted as needed), the corresponding word nodes and related semantic dependency representations (including dependency type and dependent words, etc.) are filtered out. Finally, the filtered list of nodes to be mapped and the list of semantic dependency representations are returned respectively.
[0205] 5. Projection to generate Chinese hypergraph network function
[0206] defbuild_chinese_hypergraph(filtered_nodes,filtered_relations):
[0207] The screened nodes to be mapped and the semantic dependency representations are projected to generate a Chinese hypergraph network.
[0208] parameter:
[0209] filtered_nodes(list): List of nodes to be mapped.
[0210] filtered_relations(list): list of semantic dependency representations.
[0211] return:
[0212]
[0213] This function receives the filtered list of nodes to be mapped and the list of semantic dependency representations, uses the `networkx` library to build a graph structure, adds the nodes to be mapped as nodes in the graph, and then adds edges between related nodes based on the dependency relationships in the semantic dependency representations, and finally returns the constructed Chinese hypergraph network.
[0214] 6. Main function call (Chinese word dependency tree list `dependency_trees`)
[0215]
[0216] In the above exemplary code, the semantic roles are simply and preliminarily divided based on the dependency relationship of the `spacy` library. In practical applications, it is necessary to combine the characteristics and professional knowledge of the power industry text to formulate more detailed and accurate semantic role labeling rules, such as setting specific role classification and labeling methods for different types of words such as power equipment names, operating actions, parameter descriptions, etc., to better reflect the function and status of words in the context of the power industry. Use `gensim`'s `LdaModel` for topic model mining. More power industry text data is needed to train the model, and the parameters of the model, such as the number of topics, the number of training rounds, etc., should be adjusted according to the actual needs of power industry topic classification. At the same time, other more advanced or more suitable topic model mining methods can be tried to obtain vector representations that can more accurately reflect the characteristics of power topics.
[0217] Optionally, the generation of a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel prediction library includes: performing dependency annotation on Mongolian feature words in the Mongolian parallel prediction library to obtain a Mongolian word dependency tree; based on the Mongolian word dependency tree, determining mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network to generate the Mongolian hypergraph network. To this end, the specific process of generating a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel prediction library has the following technical benefits: 1. Revealing the semantic association of Mongolian electric power terms; when expressing content related to the electric power industry, Mongolian also has rich and complex semantic relationships between various terms and words. By performing dependency annotation on Mongolian feature words in the Mongolian parallel prediction library and then obtaining a Mongolian word dependency tree, the deep semantic connection between Mongolian electric power industry terms can be clearly displayed. For example, in the Mongolian-language sentences describing the working principle of transformers, different Mongolian words have dependencies around the core word "transformer (трансформатор)", such as functional description and component association. The dependency tree can intuitively present these internal connections, which helps to deeply understand the meaning of Mongolian power texts, and dig out the collocation and constraint relationship between Mongolian terms and other words in their language context, providing a precise semantic basis for the subsequent construction of Mongolian hypergraph networks and accurate Sino-Mongolian translation. 2. Help sort out the grammatical structure of Mongolian texts; Mongolian has its own unique grammatical rules. The order of its words in sentences, word form changes, etc. carry grammatical information and are closely related to semantic expression. The Mongolian word dependency tree generated by dependency annotation also reflects the grammatical structure characteristics of Mongolian texts. For example, grammatical elements such as the case of nouns and the tense of verbs in Mongolian will affect the dependency relationship between words. Through the dependency tree, we can clearly sort out the grammatical roles played by Mongolian words of different parts of speech in sentences and the specific structures formed by mutual dependence. This is critical for accurately grasping the composition and meaning of Mongolian power industry sentences, especially when dealing with long sentences with complex structures and containing multiple Mongolian power professional terms. It can help to clearly analyze the relationship between the various parts of the sentence, avoid translation errors or semantic misunderstandings caused by unclear grammatical understanding, and further improve the accuracy of the conversion from Mongolian to Chinese in the entire Sino-Mongolian translation process. 3. Integrate diverse Mongolian text information; the Mongolian parallel prediction library collects Mongolian power industry topic description texts from multiple channels and types. These texts may differ in expression style, word usage habits, etc. By generating a dependency tree through dependency annotation, these diverse Mongolian text information can be integrated in a unified semantic and grammatical association manner.Whether the text is from the internal information of power companies in Mongolian-speaking areas, the standards and specifications issued by local industry associations, or academic works on Mongolian power from relevant scientific research institutions, as long as it involves the same or similar power industry terms and concepts, its common and individual semantic and grammatical relationships can be sorted out under the framework of the dependency tree, so that the Mongolian hypergraph network constructed based on these relationships can comprehensively and comprehensively cover various situations of Mongolian power industry expressions, enhance the processing capabilities of the corpus and the entire translation system for different Mongolian text contents, and ensure that Chinese-Mongolian translation operations can be accurately performed when facing various Mongolian power texts. 4. Efficient representation of complex semantic relationships in Mongolian: Based on the Mongolian word dependency tree, the mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network can be determined, which can represent the complex semantic relationships between Mongolian power industry terms in an efficient and flexible way. Compared with ordinary graphs, hypergraphs can connect multiple nodes with their hyperedges, which are more suitable for describing complex many-to-many dependencies between Mongolian words. For example, in a text involving fault diagnosis of power systems described in Mongolian, "short circuit fault (хγснэгт хθлбθм)" may be causally related to multiple factors such as "line aging (уран жолы гхθгжилтэй)", "overload operation (хэтих жYжиглэлтэй ажиллагаанд)", and "protection device failure (хамгаалалтын хэрэгсэл дууссан)". In a Mongolian hypergraph network, these terms can be represented by appropriate mapping nodes, and the complex relationships between them can be accurately reflected by mapping hyperedges. Compared with the traditional linear structure or simple graph structure, this representation method can present the association network between terms in the Mongolian power industry knowledge system in a more comprehensive and three-dimensional way, which helps the artificial intelligence algorithm to better learn and grasp these relationships, so that when translating between Chinese and Mongolian, it can accurately find the corresponding Chinese expression based on the complete Mongolian semantic association, and improve the accuracy and completeness of the translation. 5. Enhance the Mongolian semantic reasoning ability; once the Mongolian hypergraph network is successfully constructed, the network structure composed of its nodes and hyperedges gives the system stronger semantic reasoning ability. When encountering a new Mongolian power industry text segment for translation, the system can infer the unknown semantic association or fill in the missing information based on the connection relationship (hyperedge) between nodes (terms) in the existing Mongolian hypergraph network. For example, in a text describing the maintenance of Mongolian power equipment, it is mentioned that a certain equipment has an abnormality, but it does not clearly indicate which specific factors are related. Through the semantic connection between other similar equipment abnormalities and related influencing factors in the Mongolian hypergraph network, reasonable reasoning can be performed to assist in translating Chinese content that is more logical and realistic. This semantic reasoning capability is very helpful for dealing with texts that are not fully matched in the prediction library but are semantically related, and further expands the scope and effect of the Chinese-Mongolian translation system on the processing of diverse Mongolian-language texts in the power industry.6. It is convenient to realize Chinese-Mongolian semantic mapping and knowledge transfer; in the overall process of Chinese-Mongolian translation, the generated Mongolian hypergraph network can be used as an important intermediate structure to facilitate alignment with the Chinese hypergraph network and establish a bidirectional semantic mapping relationship. Since the Mongolian hypergraph network clearly shows the semantic structure of Mongolian power industry terms, when it is associated with the Chinese hypergraph network, it can more accurately find semantically equivalent or similar nodes (terms) and corresponding semantic relationships (hyperedges) in the two languages to achieve effective semantic mapping. Moreover, through this mapping relationship, it can also promote the transfer of knowledge between the two languages. For example, the detailed description of a certain advanced power technology in the Mongolian text can be accurately converted into Chinese expression with the help of semantic mapping between hypergraph networks, so that Chinese users can also fully understand and apply relevant technical knowledge, and promote the smooth development of technical exchanges and business development in the power industry in the Chinese and Mongolian language environment.
[0218] To this end, based on the Mongolian parallel forecast library, the specific process of generating a Mongolian hypergraph network of power industry terminology is as follows:
[0219] 1. Import necessary libraries
[0220] importspacy
[0221] importnetworkxasnx
[0222] fromcollectionsimportdefaultdict
[0223] 2. Dependency annotation and Mongolian word dependency tree generation function
[0224] defgenerate_mongolian_dependency_tree(mongolian_corpus):
[0225] The Mongolian feature words in the Mongolian parallel prediction library are annotated with dependency relationships to obtain a Mongolian word dependency tree.
[0226] parameter:
[0227] mongolian_corpus(list): Mongolian parallel prediction library, containing multiple Mongolian text contents.
[0228] return:
[0229]
[0230]
[0231] This function first tries to load a hypothetical Mongolian language model, then traverses each text in the Mongolian parallel prediction library, obtains its dependency relationship and related information of the dependent words for each word in the text, and constructs a tree structure with the word as the key and a dictionary containing information such as dependency relationships and dependent words as the value. Finally, it returns a list of Mongolian word dependency trees corresponding to all texts.
[0232] 3. Determine the mapping nodes and mapping hyperedges based on the Mongolian word dependency tree and generate Mongolian hypergraph network function
[0233] defbuild_mongolian_hypergraph(dependency_trees):
[0234] Based on the Mongolian word dependency tree, the mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network are determined to generate a Mongolian hypergraph network.
[0235] parameter:
[0236] dependency_trees(list): Mongolian word dependency tree list.
[0237] return:
[0238]
[0239] This function receives the Mongolian word dependency tree list as a parameter, traverses the word information in each dependency tree, and adds the word as a node to the graph (simulated hypergraph). If the word has other dependent words (determined by the dependency word information), an edge is added between it and the dependent words, and finally the constructed Mongolian hypergraph network structure is returned (here the graph structure of `networkx` is used to represent it, which is convenient for subsequent visualization and other operations).
[0240] 4. Main function call (Mongolian parallel prediction library `mongolian_corpus`)
[0241]
[0242] In the above implementation, the hypothetical Mongolian language model is used to process each text in the Mongolian parallel prediction library, and the information such as the dependency relationship of words is obtained to construct a dependency tree. This tree structure helps to sort out the grammatical and semantic dependencies between words in the text, and provides a basis for the subsequent hypergraph network construction. Based on the words and their dependencies in the dependency tree, the words are added as nodes to the simulated hypergraph, and the dependency connection relationship between words is reflected by adding edges, so as to construct a hypergraph network structure that can represent the complex semantic associations between Mongolian power industry terms, which is convenient for subsequent semantic mapping, reasoning and other operations in the Sino-Mongolian translation process, and helps improve the accuracy and quality of translation.
[0243] Optionally, the dependency annotation of the Mongolian feature words in the Mongolian parallel prediction library to obtain the Mongolian word dependency tree includes: vectorizing the Mongolian professional terminology dictionary of the electric power industry to obtain the standard word vector of the Mongolian professional terminology of the electric power industry; vectorizing the Mongolian amplified terminology of the electric power industry to obtain the amplified word vector of the Mongolian professional terminology of the electric power industry; clustering analysis of the standard word vector of the Mongolian professional terminology of the electric power industry and the amplified word vector of the Mongolian professional terminology of the electric power industry to obtain the cluster center vector under different semantic categories; according to the cluster center vector under the different semantic categories, the dependency annotation of the Mongolian feature words in the Mongolian parallel prediction library to obtain the Mongolian word dependency tree. To this end, the above-mentioned specific technical processing process of performing dependency annotation on the Mongolian feature words in the Mongolian parallel prediction library to obtain the Mongolian word dependency tree has the following technical benefits: 1. Unified semantic digital representation: vectorizing the Mongolian professional terminology dictionary of the electric power industry to obtain the standard word vector of the Mongolian professional terminology of the electric power industry can convert various Mongolian electric power professional terms into a unified numerical form that is easy for computer processing. Mongolian has a unique writing system and grammatical rules, and its electric power industry terms are also complex and diverse in expression. Through vectorization operations, terms such as "трансформатор (transformer)" and "генератор (generator)" are mapped to numerical vectors of specific dimensions. This unified representation allows subsequent operations such as semantic comparison, cluster analysis, and dependency labeling to be carried out based on a consistent mathematical language, avoiding the ambiguity of terms in the semantic understanding and processing of Mongolian text forms, and laying the foundation for accurately analyzing the relationship between Mongolian electric power industry terms. 2. Mining potential semantic associations; word vectors can reflect the potential semantic associations between words to a certain extent. In the vector space, the vectors corresponding to Mongolian electric power industry terms with similar semantics are often close. For example, "хYснэгт (short circuit fault)" and "цοхилт (circuit breaker fault)", they all belong to the category of power failure and have related meanings. After vectorization, the distance between their vectors in space may be relatively close. By vectorizing the Mongolian professional terminology dictionary of the power industry, these potential semantic connections can be mined using vector distance, similarity and other metrics, which helps to more comprehensively sort out the internal relationships between different terms in the Mongolian power industry knowledge system. This is very important for the subsequent accurate construction of the Mongolian word dependency tree and the grasp of Mongolian semantic accuracy in the entire Sino-Mongolian translation work, and can enable the translation system to better understand the subtle differences and correct usage of similar terms in different contexts. 3. Enriching semantic coverage; Mongolian in the power industry Augmented terms usually include some vocabulary expressions that are derived from actual business applications or newly emerged but related to standard terms. Vectorizing these augmented terms to obtain augmented word vectors of Mongolian professional terms in the power industry can further enrich the semantic coverage of the entire Mongolian power industry terminology. For example, with the development and application of power technology in Mongolian-speaking areas, some new names and new expressions generated in response to local actual conditions or new technologies will continue to emerge. Including these augmented terms in the scope of vectorization can make the constructed semantic space more in line with the actual situation of the continuous development and change of the Mongolian power industry, ensuring that these newly emerged terms will not be missed in subsequent analysis and processing. semantic information, so as to more comprehensively serve the accurate translation of various Mongolian power text contents in the process of Sino-Mongolian translation. 4. Enhance the adaptability of the terminology system; the vectorized augmented word vectors can participate in subsequent analysis operations together with the standard word vectors, making the entire Mongolian power industry Chinese terminology system more adaptable when facing the constantly updated knowledge, concepts and expressions in the industry. For example, when new Mongolian terminology related to renewable energy power generation is added to the power industry discourse system, its corresponding augmented word vector can be integrated into the existing vector space, and it can be correlated and interacted with the Mongolian terminology vectors in the traditional fields of power generation and transmission, which is convenient for accurate annotation in dependency relationship annotation and other links. Accurately determine its position in the entire Mongolian power industry semantic network, and then ensure that the Sino-Mongolian translation system built on this basis can promptly process Mongolian text content involving these new terms and keep up with the development of the Mongolian power industry. 5. Summarize semantic categories and simplify the sorting of semantic relationships; cluster analysis is performed on the standard word vectors of Mongolian professional terms in the power industry and the amplified word vectors of Mongolian professional terms in the power industry to obtain cluster center vectors under different semantic categories, which can summarize and classify the numerous and complex Mongolian power industry terms according to semantic similarity. For example, all terms related to power generation equipment described in Mongolian can be clustered into one category, and those related to transmission lines can be clustered into another category, etc.This classification method greatly simplifies the difficulty of sorting out the semantic relationship between terms in the subsequent process, so that when constructing the Mongolian word dependency tree, the dependency relationship between terms can be grasped from a more macroscopic semantic category level, avoiding the dilemma of analyzing the complex relationship between a large number of individual terms one by one, and improving the efficiency and accuracy of the entire semantic relationship sorting and dependency annotation. 6. Highlighting semantic commonalities and differences, assisting accurate annotation: The different semantic categories and their cluster center vectors obtained by cluster analysis clearly show the semantic commonalities of terms in each category and the semantic differences between different categories. When the Mongolian feature words in the Mongolian parallel prediction library are annotated with dependency relationships based on the cluster center vectors, these commonalities and differences become important references. For example, Mongolian terms in the same cluster category often have similar grammatical functions and dependent objects in sentences, while terms in different categories may have obvious hierarchical structures in terms of dependency relationships (e.g., Mongolian terms related to power generation may be pre-dependent factors of Mongolian terms related to power transmission). With the help of the results of cluster analysis, it is possible to more accurately determine the dependency relationship between each feature word and other words, and mark out the dependency tree that conforms to the actual semantics and grammatical logic of the Mongolian power industry text, thereby improving the accuracy of the Mongolian source language text structure and semantic understanding during the Chinese-Mongolian translation process. 7. Optimize dependency annotation based on semantic categories; perform dependency annotation on Mongolian feature words in the Mongolian parallel prediction library according to the cluster center vectors under different semantic categories, which can make full use of the semantic information summarized by the previous clustering to make the dependency annotation more reasonable and accurate. Since the cluster center vector reflects the typical characteristics of a certain type of semantic category, during the annotation process, the feature word can more accurately determine its dependent object and dependency type in the sentence based on the semantic category to which it belongs and the similarity with the cluster center vector. For example, if a Mongolian feature word is determined to belong to the semantic category of "Mongolian power equipment fault diagnosis" (by comparing it with the corresponding cluster center vector), then when annotating the dependency relationship, it is possible to more specifically find Mongolian words such as fault phenomena and diagnostic methods related to it to establish dependency relationships, so that the dependency tree can better reflect the semantic structure of Mongolian power industry texts in this field, and provide a high-quality semantic foundation for the subsequent construction of Mongolian hypergraph networks and Sino-Mongolian translation. 8. Improve the adaptability of the dependency tree to Mongolian power industry texts; the final Mongolian word dependency tree, based on this dependency annotation method combined with the cluster center vector, will be more in line with the characteristics and logic of the Mongolian power industry texts themselves.Mongolian power industry texts have unique professional terminology usage habits, grammatical structures, and semantic association patterns. The dependency tree constructed through the above steps can accurately capture and present these characteristics. Whether it is describing the Mongolian power system operating principles, equipment operation procedures, or fault handling and other types of text content, the dependency tree can clearly show the internal connections between the words, so that the subsequent Mongolian hypergraph network generated based on the dependency tree and the entire Sino-Mongolian translation system can better meet actual business needs when processing Mongolian power industry texts, improve the accuracy and fluency of translation, and effectively promote the business development of the power industry in the Sino-Mongolian language communication scenario.
[0244] To this end, the above-mentioned specific technical processing process of labeling the dependency relationship of the Mongolian feature words in the Mongolian parallel prediction library to obtain the Mongolian word dependency tree is as follows:
[0245] 1. Import necessary libraries
[0246] fromgensim.modelsimportWord2Vec
[0247] importnumpyasnp
[0248] fromsklearn.clusterimportKMeans
[0249] importspacy
[0250] 2. Vectorize the Mongolian professional terminology dictionary for the power industry
[0251] defvectorize_mongolian_standard_terms(term_file_path,vector_size=100,window=5,min_count=1,workers=4):
[0252] The Mongolian professional terminology dictionary of the power industry is vectorized to obtain the standard word vector of Mongolian professional terminology in the power industry.
[0253] parameter:
[0254] term_file_path(str): The file path for storing the Mongolian professional terminology dictionary for the power industry, with one term per line.
[0255] vector_size(int): The dimension size of the word vector, the default value is 100.
[0256] window(int): The window size for word vector training, the default value is 5.
[0257] min_count(int): Ignore words with a lower occurrence number than this value during word vector training. The default value is 1.
[0258] workers (int): The number of threads used when training word vectors. The default value is 4.
[0259] return:
[0260]
[0261] `This function first reads the content of the Mongolian professional terminology dictionary of the power industry from the specified file path, extracts the terms in each line and forms a list. Then it uses the `Word2Vec` model to train according to the set parameters (such as vector dimension, window size, etc.), obtains the word vector corresponding to each Mongolian term, and stores it in the dictionary in the form of term as key and word vector as value and returns it.
[0262] 3. Vectorization of Mongolian-language amplified terms in the power industry
[0263] defvectorize_mongolian_augmented_terms(augmented_term_file_path,vector_size=100,window=5,min_count=1,workers=4):
[0264] The Mongolian amplified terms of the power industry are vectorized to obtain the amplified word vectors of Mongolian professional terms in the power industry.
[0265] parameter:
[0266] augmented_term_file_path(str): The file path that stores Mongolian augmented terms for the power industry, one term per line.
[0267] vector_size(int): The dimension size of the word vector, the default value is 100.
[0268] window(int): The window size for word vector training, the default value is 5.
[0269] min_count(int): Ignore words with a lower occurrence number than this value during word vector training. The default value is 1.
[0270] workers (int): The number of threads used when training word vectors. The default value is 4.
[0271] return:
[0272]
[0273] The logic of this function is similar to the function for vectorizing the Mongolian professional terminology dictionary. It reads the content from the file storing Mongolian augmented terms, and also uses the `Word2Vec` model for training to obtain the word vector corresponding to each augmented term, and returns the result in the form of a dictionary with the augmented term as the key and the word vector as the value.
[0274] 4. Cluster analysis of standard word vectors and augmented word vectors
[0275] defcluster_analysis(standard_term_vectors,augmented_term_vectors,n_clusters=5):
[0276] Cluster analysis is performed on the standard word vectors and augmented word vectors of Mongolian professional terminology in the power industry to obtain the cluster center vectors under different semantic categories.
[0277] parameter:
[0278] standard_term_vectors(dict): dictionary of standard word vectors for Mongolian professional terminology in the power industry.
[0279] augmented_term_vectors(dict): Dictionary of augmented term vectors for Mongolian professional terms in the power industry.
[0280] n_clusters (int): The number of clustering categories, the default is 5.
[0281] return:
[0282]
[0283] This function first merges the standard word vectors and augmented word vectors of Mongolian professional terminology in the power industry, records the corresponding terms, and then converts the merged word vectors into `numpy` array format, uses the `KMeans` algorithm for clustering (the default clustering in the example is 5 categories, and the number of clusters can be adjusted according to specific semantic classification requirements), obtains the cluster center vector, and assigns the terms to different cluster categories according to the clustering results. Finally, it returns the cluster center vector and a dictionary containing a list of terms under each cluster category.
[0284] 5. According to the cluster center vector, the Mongolian feature words in the Mongolian parallel prediction library are labeled with dependencies to obtain the Mongolian word dependency tree.
[0285] defannotate_dependency_relation(cluster_centers,term_clusters,mongolian_corpus):
[0286] According to the cluster center vectors under different semantic categories, the Mongolian feature words in the Mongolian parallel prediction library are annotated with dependency relationships to obtain a Mongolian word dependency tree.
[0287] parameter:
[0288] cluster_centers (numpy.ndarray): Cluster center vectors under different semantic categories.
[0289] term_clusters(dict): term clustering results, the key is the cluster category index, and the value is the term list.
[0290] mongolian_corpus(list): Mongolian parallel prediction library, containing multiple Mongolian texts.
[0291] return:
[0292]
[0293]
[0294] This function processes each text in the Mongolian parallel prediction library with the help of an assumed Mongolian language model. For each word in the text, first calculate its similarity with each cluster center vector, determine the most similar cluster category to which it belongs, and obtain the grammatical role (dependency type) of the word in the sentence and the dependent words and other information. After integrating this information, construct the node information of the dependency tree, represent the dependency tree of each text in the form of a dictionary, and return a list containing all the text dependency trees.
[0295] 6. Main function call (file path and Mongolian parallel prediction library content)
[0296]
[0297] In the above example code, the `vectorize_mongolian_standard_terms` and `vectorize_mongolian_augmented_terms` functions are used to vectorize the Mongolian professional terminology dictionary and augmented terms in the power industry, respectively. In practical applications, the parameter settings of the `Word2Vec` model can be further optimized according to the characteristics of Mongolian power industry terms and subsequent processing requirements, such as by experimenting with different vector sizes to find the dimension that best reflects the semantic differences of the terms, or adjusting the window size to adapt to the common context range of the terms in the text. The `cluster_analysis` function uses the `KMeans` algorithm for clustering, and the number of clusters is set by the parameter `n_clusters` (the default is 5 in the example, but it can be adjusted according to the degree of sophistication required for the semantic classification of Mongolian power industry terms). The returned results include the cluster center vector and the dictionary after the terms are classified according to the clustering results, so as to facilitate the subsequent dependency annotation based on these classification information. The `annotate_dependency_relation` function is the key part of the whole process. It processes each text in the Mongolian parallel prediction library with the help of the Mongolian language model. For each word in the text, first determine its cluster category, then obtain its grammatical role in the sentence and dependent words and other information, and build the dependency tree node information. In practical applications, the rules and methods of dependency annotation can be further improved and refined according to the grammatical and semantic characteristics of Mongolian, so as to obtain a more accurate dependency tree that is more in line with the actual logic of Mongolian power industry texts.
[0298] Optionally, based on the Mongolian word dependency tree, determining the mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network to generate the Mongolian hypergraph network includes: determining the word nodes in the Mongolian word dependency tree, and annotating the word nodes with semantic roles to determine the role of each word in the Mongolian main text; mining the topic model in the Mongolian word dependency tree according to the role of each word in the Mongolian main text to obtain a Mongolian power topic vector; filtering out the nodes to be mapped and the corresponding semantic dependency representations from the Mongolian word dependency tree according to the Mongolian power topic vector; projecting the nodes to be mapped into the Mongolian hypergraph network to form the mapping nodes, and projecting the semantic dependency representations into the Mongolian hypergraph network to form mapping hyperedges to generate the Mongolian hypergraph network. To this end, the above-mentioned specific technical processing process of determining the mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network based on the Mongolian word dependency tree to generate the Mongolian hypergraph network has the following technical benefits: 1. Accurate analysis of word functions: Determine the word nodes in the Mongolian word dependency tree and annotate them with semantic roles, which can accurately clarify the role of each Mongolian word in the Mongolian main text. In the Mongolian power industry text, different words have different functions and status. For example, in the sentence "Трансформатор уранжолыг θθрчлθжбайна (transformer changes the transmission line)", "Трансформатор (transformer)" is the executor role of the action, and "уранжолыг (transmission line)" is the object of the action. Through semantic role annotation, the function and status of words in the sentence are clearly presented, which helps to deeply understand the semantic structure of Mongolian texts, avoid vague cognition of the meaning and role of words, and lay the foundation for the subsequent construction of a hypergraph network that accurately reflects the knowledge relationship of the Mongolian power industry. 2. Assist cross-text semantic analysis: When processing a large amount of Mongolian power industry main text, the word nodes with semantic role annotation are convenient for cross-text analysis. Since the annotation unifies the role measurement standards of words in different sentences and texts, we can more easily compare and analyze the usage and collocation of words with similar roles in different contexts. For example, in multiple texts describing Mongolian power equipment failures, the word nodes with different semantic roles such as the cause of the failure and the failure phenomenon are annotated, which can summarize the commonalities and characteristics related to common failures of different Mongolian power equipment, thereby enriching and improving the semantic information required for the subsequent construction of the hypergraph network, and improving the hypergraph network's ability to represent the overall knowledge system of the Mongolian power industry. 3. Extract macro-topic features: According to the role of each word in the Mongolian main text, the topic model in the Mongolian word dependency tree is mined to obtain the Mongolian power topic vector. This step can extract macro-topic features from a large amount of scattered word information.The Mongolian power industry involves many sub-sectors and complex business content. Through topic model mining, the features of different topic levels in the text, such as power generation, transmission, substation, and distribution, can be quantified in the form of vectors. For example, a group of Mongolian texts around the theme of "transmission lines" can summarize the key elements such as common line structures, transmission parameters, and related equipment under the theme after topic model mining, so that the subsequent hypergraph network can integrate semantic relationships at the topic level when constructing, avoiding the processing of too many micro-word relationships, and improving the efficiency of hypergraph network construction and the overall grasp of the knowledge system of the Mongolian power industry. 4. Capturing potential topic associations in texts: Topic vectors can capture potential topic associations between different texts. Even if the texts differ in surface expressions, as long as they involve the same or related Mongolian power topics, the similarity of their topic vectors can be reflected. For example, a Mongolian text introducing new transmission technology and another Mongolian text on the optimization and transformation of transmission lines have different words and specific descriptions, but through topic vectors, their relevance under the large theme of transmission can be found. This capture of potential topic associations helps to more reasonably connect semantic information from different text sources when constructing a hypergraph network, allowing the hypergraph network to more comprehensively cover all aspects of the Mongolian power industry and the internal connections between them, and enhance the richness and completeness of the hypergraph network in semantic expression. 5. Focus on key semantic elements: According to the Mongolian power theme vector, the nodes to be mapped and the corresponding semantic dependency representations are screened out from the Mongolian word dependency tree, which can focus on the semantic elements that are most critical to the construction of the hypergraph network. In a complex Mongolian word dependency tree, not all word nodes and dependencies are equally important for reflecting the core knowledge of the Mongolian power industry. By screening the topic vector, those parts that are closely related to the Mongolian power theme and can highlight the essential connection between Mongolian power industry terms can be selected. For example, in a dependency tree corresponding to a Mongolian power system operation text containing many descriptive words, key nodes such as "генератор (generator)", "трансформатор (transformer)", "Yсэгхγлээжавах (power output)" and their dependencies are selected based on the topic vector, and the interference of some relatively minor modifying and general words is removed, so that the elements subsequently projected into the hypergraph network are the most able to reflect the substantive content of the Mongolian power business, which helps to build a hypergraph network that expresses the semantics of the Mongolian power industry in a concise and efficient manner. 6. Optimize the semantic structure of the hypergraph network: The screening process is actually an optimization of the semantic structure of the hypergraph network. It ensures that the mapping nodes and mapping hyperedges entering the hypergraph network are all centered around the Mongolian power theme and conform to the knowledge logic of the Mongolian power industry, avoiding the hypergraph network from becoming complex in structure and confusing in semantics due to too many redundant or irrelevant elements.The hypergraph network constructed in this way can play a more efficient and accurate role in semantic query, reasoning, and semantic mapping with the Chinese hypergraph network, improving the overall performance of Chinese-Mongolian translation and Mongolian power industry knowledge processing based on the hypergraph network. 7. Build a flexible and powerful semantic network; project the nodes to be mapped into the Mongolian hypergraph network to form mapping nodes, and project the semantic dependency representation into the Mongolian hypergraph network to form mapping hyperedges, thereby generating a Mongolian hypergraph network, which can build a flexible and powerful semantic network to represent Mongolian power industry knowledge. The characteristics of hypergraph networks enable them to connect multiple nodes through hyperedges, which is very suitable for describing the many-to-many complex semantic relationships in the Mongolian power industry. For example, "хγснэгтхθлбθм (short circuit fault)" may have dependency relationships with multiple "уранжолыгхθгжилтэй (line aging)", "хэтихжγжиглэлтэйажиллагаанд (overload operation)", "хамгаалалтынхэрэгсэлдууссан (protection device failure)", etc. In the hypergraph network, this complex relationship can be accurately presented through appropriate mapping nodes and mapping hyperedges. Compared with traditional graph structures or linear structures, it can better fit the actual semantic scenarios of the Mongolian power industry and provide more effective data structure support for artificial intelligence in learning and processing the relationship between Mongolian power industry terms. 8. Realize semantic integration and knowledge association: The Mongolian hypergraph network generated by this projection method realizes the deep integration of semantics in Mongolian power industry texts and the comprehensive association of knowledge. It integrates the word nodes and their dependencies mined from different texts and different thematic perspectives in a unified hypergraph network form, so that the Mongolian power industry knowledge originally scattered in various texts can be gathered and interconnected. For example, the knowledge about Mongolian power equipment manufacturing and the knowledge about Mongolian power system operation and maintenance can be interconnected through the nodes and hyperedges in the hypergraph network to form a complete Mongolian power industry knowledge graph, which is not only convenient for accurately finding the corresponding semantic expression in the Chinese-Mongolian translation, but also helps Mongolian power industry personnel to systematically learn, understand and apply the entire industry knowledge system, and promote the in-depth development of Mongolian power industry business and technical exchanges and inheritance.
[0299] To this end, the above-mentioned specific technical processing process of determining the mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network based on the Mongolian word dependency tree to generate the Mongolian hypergraph network is as follows:
[0300] 1. Import necessary libraries
[0301] importspacy
[0302] importgensim
[0303] importnetworkxasnx
[0304] importnumpyasnp
[0305] fromcollectionsimportdefaultdict
[0306] 2. Determine word nodes and perform semantic role labeling functions
[0307] defannotate_semantic_roles(dependency_trees):
[0308] Perform semantic role labeling on word nodes in Mongolian word dependency tree.
[0309] parameter:
[0310] dependency_trees(list): A list containing Mongolian word dependency trees. Each dependency tree is represented in dictionary form, with the key being the word and the value being a dictionary containing dependency information.
[0311] return:
[0312]
[0313]
[0314] This function receives a list of Mongolian word dependency trees as parameters, first loads the Mongolian language model (in practice, it is necessary to ensure that the model is adapted to Mongolian grammar and lexical features), then for each dependency tree, organizes the words in the tree into text, and uses the model for analysis and processing. The semantic role is simply determined based on the dependency type of the word, and finally the semantic role annotation is added to the information dictionary of the corresponding word, and the annotated dependency tree list is returned.
[0315] 3. Obtain Mongolian electricity topic vector function based on semantic role mining topic model
[0316] defextract_theme_vectors(annotated_trees):
[0317] The topic model is mined based on the dependency tree after annotating the semantic roles to obtain the Mongolian electricity topic vector.
[0318] parameter:
[0319] annotated_trees(list): A list of Mongolian word dependency trees annotated with semantic roles.
[0320] return:
[0321]
[0322] The function first extracts the text content from the dependency tree after annotating the semantic roles and builds a text list. Then it uses the `gensim` library to build the dictionary and corpus, and then uses `LdaModel` to mine the topic model (the number of topics is set to 5 in the example, which can be adjusted according to the fineness of the Mongolian power industry topic classification), converts the topic distribution corresponding to each text into a fixed-length vector form, and finally returns an array containing all text topic vectors.
[0323] 4. Screening nodes to be mapped and semantic dependency representation functions based on Mongolian power topic vectors
[0324] deffilter_nodes_and_relations(theme_vectors,annotated_trees):
[0325] According to the Mongolian electricity topic vector, the nodes to be mapped and the semantic dependency representation are selected from the dependency tree after the semantic roles are annotated.
[0326] parameter:
[0327] theme_vectors(numpy.ndarray): Mongolian electricity theme vector array.
[0328] annotated_trees(list): A list of Mongolian word dependency trees annotated with semantic roles.
[0329] return:
[0330]
[0331]
[0332] This function filters each dependency tree labeled with semantic roles based on the Mongolian power topic vector. For the case where the weight in the topic vector is large (the threshold is set to 0.2 in the example, which can be adjusted as needed), the corresponding word nodes and related semantic dependency representations (including dependency type and dependent words, etc.) are filtered out and summarized into the list of nodes to be mapped and the list of semantic dependency representations, and finally a tuple consisting of the two lists is returned.
[0333] 5. Projection to generate Mongolian hypergraph network function
[0334] defbuild_mongolian_hypergraph(filtered_nodes,filtered_relations):
[0335] The selected nodes to be mapped and the semantic dependency representations are projected to generate a Mongolian hypergraph network.
[0336] parameter:
[0337] filtered_nodes(list): List of nodes to be mapped.
[0338] filtered_relations(list): list of semantic dependency representations.
[0339] return:
[0340]
[0341] This function receives the filtered list of nodes to be mapped and the list of semantic dependency representations as parameters, uses the `networkx` library to build a graph structure, adds the nodes to be mapped as nodes in the graph, and then adds edges between related nodes based on the dependency relationships in the semantic dependency representations. Finally, it returns the constructed Mongolian hypergraph network.
[0342] 6. Main function call (Mongolian word dependency tree list `dependency_trees`)
[0343]
[0344] In the above exemplary code, the semantic roles are simply and preliminarily divided based on the dependency relationship of the `spacy` library, and the annotation rules are formulated in combination with the characteristics and professional knowledge of the Mongolian power industry text. For example, specific role classification and annotation methods are set for different types of words such as Mongolian power equipment names, operating actions, parameter descriptions, etc., so as to better reflect the function and status of words in the Mongolian context. Use `gensim`'s `LdaModel` to mine the topic model, use Mongolian power industry text data to train the model, and adjust the model parameters according to the actual needs of Mongolian power industry topic classification, such as the number of topics, the number of training rounds, etc., and try other more suitable topic model mining methods to obtain vector representations that more accurately reflect the characteristics of Mongolian power topics. In screening the nodes to be mapped and the semantic dependency representation, the weight threshold in the topic vector is used for judgment. In fact, more factors can be comprehensively considered, such as the importance of words in the Mongolian power industry terminology system, the frequency of occurrence in different texts, etc., to build a more reasonable and accurate screening mechanism to ensure that the elements entering the hypergraph network are the most representative and key Mongolian power industry semantic information. Use the `networkx` library to build a Mongolian hypergraph network. If you strictly follow the characteristics of the hypergraph, you can more accurately handle the complex relationship between hyperedges and nodes and perform subsequent efficient calculations and analysis.
[0345] Optionally, the bidirectional semantic association of the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words in electric power industry terminology includes: fusing the Chinese hypergraph network and the Mongolian hypergraph network to obtain a cross-language hypergraph structure, the cross-language hypergraph structure containing Chinese word vertices, Mongolian word vertices and local hyperedges constructed based on semantic associations within each of them, and adding cross-language cross-language hyperedges to connect corresponding Chinese and Mongolian word vertices, the cross-language hyperedges representing the association between electric power industry terminology with similar semantics in the two languages; based on a graph convolutional network, jointly semantic mining the cross-language hypergraph structure to obtain a baseline bidirectional semantic association; propagating the baseline bidirectional semantic association to mine Chinese and Mongolian words that have indirect associations and semantically correspond to each other to generate a supplementary bidirectional semantic association; aligning the baseline bidirectional semantic association and the supplementary bidirectional semantic association to construct a Chinese-Mongolian semantic framework and a Mongolian-Chinese semantic framework; based on the Chinese-Mongolian semantic framework and the Mongolian-Chinese semantic framework, establishing a bidirectional semantic mapping relationship between Chinese words and Mongolian words in electric power industry terminology. To this end, the above-mentioned specific technical processing process of bidirectional semantic association between the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between the Chinese words and Mongolian words of the power industry terminology has the following technical benefits: 1. Unified integration of semantic information: The Chinese hypergraph network and the Mongolian hypergraph network are fused to obtain a cross-language hypergraph structure, which can unify the semantic information about the power industry terminology in the two languages into a data structure. The Chinese hypergraph network reflects the complex semantic association between the Chinese power industry terms, and the Mongolian hypergraph network also reflects the semantic relationship of the Mongolian power industry terms. Through fusion, a cross-language hypergraph structure is formed, which contains both local hyperedges built based on semantic associations within each language and newly added cross-language hyperedges connecting the corresponding Chinese and Mongolian word vertices, bringing together the scattered semantic knowledge of the two languages, so that subsequent processing can comprehensively mine and utilize the semantic connection between the Chinese and Mongolian power industry terms based on this overall structure, avoiding the problem of information isolation that may occur when processing the two languages separately, and laying the foundation for accurately establishing a bidirectional semantic mapping relationship. 2. Intuitively present cross-language semantic correspondence: The cross-language hyperedges in the cross-language hypergraph structure clearly represent the relationship between the power industry terms with similar semantics in the two languages, presenting the cross-language semantic correspondence in an intuitive way. For example, the Chinese word "transformer" and the Mongolian word "трансформатор" are connected through cross-language hyperedges, and we can directly see the semantically equivalent relationship between these two words in the power industry.This intuitive presentation helps to quickly grasp the matching of Chinese and Mongolian power industry terms at the semantic level, facilitates manual verification and subsequent in-depth semantic mining and mapping relationship improvement with the help of algorithms, especially when dealing with a large number of complex power industry terms, it can help to sort out the semantic correspondence between different languages. 3. Enhanced semantic representation ability: The semantic representation ability of the fused cross-language hypergraph structure is enhanced compared to the separate Chinese or Mongolian hypergraph network. It comprehensively considers the grammatical and lexical characteristics of the two languages and the semantic usage habits in the context of the power industry. The associations established through cross-language hyperedges can reflect more semantic information at the language level and industry knowledge level. For example, some Chinese power terms may have multiple expressions in Mongolian, or different Chinese expressions can be summarized by the same term in Mongolian. The cross-language hypergraph structure can better capture and reflect these complex semantic correspondences, thereby more comprehensively and accurately describing the semantic relationship between Chinese and Mongolian power industry terms, and providing richer materials for subsequent semantic mining and mapping. 4. Automatic learning of semantic features: Based on the graph convolutional network (GCN), the cross-language hypergraph structure is jointly semantically mined, and the GCN automatic learning ability can be used to extract deep semantic features from the rich semantic information contained in the hypergraph structure. GCN can update the representation of the node itself by aggregating the feature information of the node neighbors. In the cross-language hypergraph structure, it will comprehensively consider the Chinese word vertices, Mongolian word vertices, and the semantic information transmitted between them through local hyperedges and cross-language hyperedges, and mine the semantic commonalities and differences of different words in the cross-language context, and automatically find those Chinese and Mongolian power industry terminology pairs with direct semantic associations, and then obtain the benchmark bidirectional semantic associations. Compared with manually defining rules to find semantic associations, this automatic learning method is more efficient and can mine some potential semantic connections that are not easy to be discovered manually, which improves the accuracy and comprehensiveness of establishing semantic mapping relationships. 5. Consider the global semantic structure: When performing semantic mining, the graph convolutional network will consider the global semantic structure of the entire cross-language hypergraph structure, rather than looking at individual words in isolation. It places each word vertex in the semantic network of the entire hypergraph for analysis, and can capture the indirect semantic influence caused by the mutual association between multiple words. For example, a Chinese power term may have an indirect semantic association with a Mongolian term through a series of other related terms. GCN can accurately identify this global semantic relationship in the hypergraph structure, so that the obtained baseline bidirectional semantic association is not only limited to the surface and simple word correspondence, but based on the overall semantic structure, it mines semantic associations that are more in line with the knowledge logic of the power industry, providing high-quality basic data for the subsequent further improvement of the semantic mapping relationship. 6. Adapt to complex semantic relationship mining: The semantic relationships between power industry terms are often complex and diverse. There are not only simple one-to-one correspondences, but also many-to-many and one-to-many complex situations.Graph convolutional networks, with their powerful nonlinear modeling capabilities and advantages in processing graph structured data, can well adapt to the mining needs of such complex semantic relationships. In the cross-language hypergraph structure, whether multiple Chinese terms correspond to one Mongolian term (such as the same type of power equipment with different Chinese expressions corresponds to a standard term in Mongolian), or a Chinese term has semantic associations with multiple Mongolian terms in different contexts (such as a general Chinese term for power operation has different corresponding expressions in Mongolian with detailed distinctions), GCN can mine the corresponding benchmark bidirectional semantic associations through learning and analyzing the hypergraph structure, ensuring that important semantic correspondences are not missed, and improving the integrity of the semantic mapping of the entire Sino-Mongolian power industry terminology. 7. Expanding the scope of semantic associations: Propagating the benchmark bidirectional semantic associations, mining Chinese and Mongolian words with indirect associations and semantically corresponding to each other to generate supplementary bidirectional semantic associations, can effectively expand the scope of semantic associations between Sino-Mongolian power industry terms. The benchmark bidirectional semantic associations mainly focus on direct semantic correspondences, while in the actual language and power industry knowledge system, there are still a large number of terms that are related to each other through indirect channels. For example, a Chinese term for power equipment may have a functional association with another Chinese term, and this related Chinese term has a direct semantic correspondence with a term in Mongolian. Through association propagation, the indirect semantic association between the original Chinese term for power equipment and that term in Mongolian can be discovered, thereby incorporating more previously undiscovered semantic correspondences into the overall semantic mapping system, making the semantic connection network between Chinese and Mongolian power industry terms richer and more complete, and improving the coverage of subsequent semantic mapping relationships for different text content processing. 8. Improve the logic of semantic mapping: Supplementing the mining of bidirectional semantic associations helps to improve the logical chain of semantic mapping, making it more in line with the internal logic of power industry knowledge and the conversion rules between languages. In the text of the power industry, the associations between different terms are intricate. By mining indirect associations, this complex semantic relationship can be reflected in the semantic mapping relationship in a more reasonable and coherent way. For example, in the text describing the operation process of the power system, there may be indirect connections between the Chinese and Mongolian terms involved in each link. Mining these connections and adding them to the semantic mapping relationship can make the Chinese-Mongolian translation based on this more fluent and natural, avoiding the problem of logical incoherence or inconsistency with the actual situation of the industry caused by only considering direct semantic correspondence, thus improving the quality and accuracy of the Chinese-Mongolian translation. 9. Enhance the depth of semantic understanding: By mining and supplementing two-way semantic associations, we can deeply understand the mutual relationship between power industry terms in different languages at a broader semantic level, and enhance the overall semantic understanding depth of the power industry knowledge system in the two languages.It is no longer limited to simple, superficial terminology correspondence, but explores the semantic connection between words from the perspective of the entire industry knowledge network, revealing the deep semantic logic hidden behind different language texts. This in-depth understanding helps to better grasp the accurate meaning and usage of Sino-Mongolian power industry terms in various specific contexts, provide a more solid semantic foundation for accurate semantic mapping and high-quality Sino-Mongolian translation, and further promote the technical dissemination and business cooperation of the power industry in the Sino-Mongolian language communication environment. 10. Establish a standardized semantic mapping system; align the baseline bidirectional semantic association and the supplementary bidirectional semantic association to build a Sino-Mongolian semantic framework and a Mongolian-Chinese semantic framework, and establish a standardized and systematic semantic mapping system. The Sino-Mongolian semantic framework clarifies the semantic mapping rules and corresponding relationships from Chinese to Mongolian, and the Mongolian-Chinese semantic framework determines the mapping logic from Mongolian to Chinese. The two frameworks work together to organize and standardize the complex and diverse semantic associations between Sino-Mongolian power industry terms. Whether developing an automatic Chinese-Mongolian translation system or manually checking the corresponding terms, the corresponding semantic mapping can be accurately and clearly found based on these two frameworks, avoiding confusion or inconsistency in semantic correspondence, and improving the standardization and reliability of the entire Chinese-Mongolian power industry terminology processing process. 11. Improve the accuracy and consistency of semantic mapping: By constructing a semantic framework through alignment operations, the inconsistent and inaccurate parts that may exist in the baseline bidirectional semantic associations and supplementary bidirectional semantic associations can be adjusted and optimized to further improve the accuracy and consistency of semantic mapping. In the process of mining semantic associations, due to factors such as the complexity of data and the limitations of algorithms, individual semantic associations may be inaccurate or conflicts between different associations may occur. By aligning and constructing a semantic framework, the rationality of the entire semantic association system can be comprehensively considered, and these problems can be corrected to ensure that the semantic mapping from Chinese to Mongolian and from Mongolian to Chinese can follow unified and accurate rules, so that the Chinese-Mongolian translation and other operations involving Chinese-Mongolian power industry terminology based on this are more accurate and reliable, and reduce translation errors or understanding deviations caused by semantic mapping errors. 12. It is convenient to update and maintain semantic associations; the establishment of the Sino-Mongolian semantic framework and the Mongolian-Chinese semantic framework facilitates the subsequent update and maintenance of semantic associations. With the continuous development of the power industry, new terms and concepts will continue to emerge, and existing semantic relationships may also change. In this case, based on the existing semantic framework, it is possible to more clearly locate the parts that need to be updated or adjusted, integrate the new semantic associations according to the established framework rules, and modify the old relationships that do not conform to the actual situation to ensure that the semantic mapping relationship can always adapt to the development of the power industry and the actual needs of Sino-Mongolian language communication, and maintain the timeliness and effectiveness of the entire Sino-Mongolian power industry terminology semantic system.13. Achieve accurate and efficient translation between China and Mongolia: The most direct benefit of establishing a bidirectional semantic mapping relationship between Chinese and Mongolian terms in the power industry based on the Sino-Mongolian semantic framework and the Mongolian-Chinese semantic framework is that it can achieve accurate and efficient translation between China and Mongolia. When dealing with Chinese or Mongolian texts related to the power industry, whether translating Chinese into Mongolian or Mongolian into Chinese, the corresponding words and expressions can be found quickly and accurately based on the established bidirectional semantic mapping relationship, avoiding the tedious process of manual translation that requires a lot of dictionary reference or empirical guessing. At the same time, it also overcomes the problem of inaccurate and unprofessional translation that may occur in traditional machine translation due to the lack of semantic mapping in professional fields, greatly improving the efficiency and quality of text translation between China and Mongolia in the power industry, and promoting technical exchanges and business cooperation between the power industries of China and Mongolia. 14. Promote knowledge sharing and dissemination in the power industry: Accurate bidirectional semantic mapping relationships help promote the sharing and dissemination of knowledge in the power industry in both Chinese and Mongolian language environments. By accurately translating the advanced technologies, management experience, research results and other contents of the power industry in Chinese into Mongolian, and translating the relevant knowledge in Mongolian into Chinese, the power industry practitioners, researchers, learners and others in China and Mongolia can better obtain the valuable knowledge resources in each other's language, break the language barrier, broaden the knowledge horizon, and promote the entire power industry to learn from each other's experience, innovate technology and develop collaboratively in a wider range, so as to promote the continuous progress of the power industry. 15. Ensure the stability and reliability of semantic correspondence: The bidirectional semantic mapping relationship established based on the Sino-Mongolian semantic framework and the Mongolian-Chinese semantic framework has high stability and reliability. These two semantic frameworks have comprehensively sorted out, standardized and optimized the semantic associations, so that the mapping relationship is not based on temporary and one-sided semantic judgments, but is based on systematic and in-depth semantic analysis. Therefore, in the long-term processing of Sino-Mongolian power industry terminology, this mapping relationship can play a role continuously and stably, ensuring the accuracy and consistency of semantic correspondence between Sino-Mongolian power industry terminology in different texts and different scenarios, and providing solid semantic support for the power industry in Sino-Mongolian language communication.
[0346] To this end, the above-mentioned specific technical processing process of bidirectionally semantically associating the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words in the electric power industry terminology is as follows:
[0347] Here, the `networkx` library is used to process the graph structure, and the `torch_geometric` library is used to build a graph convolutional network (GCN) for semantic mining operations.
[0348] 1. Import necessary libraries
[0349] importnetworkxasnx
[0350] importtorch
[0351] importtorch_geometric
[0352] fromtorch_geometric.dataimportData
[0353] fromtorch_geometric.nnimportGCNConv
[0354] importnumpyasnp
[0355] 2. Fusion of Chinese hypergraph network and Mongolian hypergraph network to obtain cross-language hypergraph structure function
[0356] deffuse_graphs(chinese_graph,mongolian_graph):
[0357] The Chinese hypergraph network and the Mongolian hypergraph network are fused to obtain a cross-language hypergraph structure.
[0358] parameter:
[0359] chinese_graph(networkx.Graph): Chinese hypergraph network.
[0360] mongolian_graph(networkx.Graph): Mongolian hypergraph network.
[0361] return:
[0362]
[0363] This function receives the graph structures representing the Chinese hypergraph network and the Mongolian hypergraph network as parameters. It first adds the nodes (word vertices) and local hyperedges in the Chinese hypergraph network to the newly constructed cross-language hypergraph structure, and marks the node language as Chinese. Then it does the same for the Mongolian hypergraph network, marking the language as Mongolian. Then it adds cross-language hyperedges through a hypothetical `are_similar` function to connect the semantically similar Chinese and Mongolian word vertices, and finally returns the constructed cross-language hypergraph structure.
[0364] 3. Convert the cross-language hypergraph structure into a format suitable for graph convolutional network processing
[0365] defgraph_to_torch_data(graph):
[0366] Convert the cross-language hypergraph structure to the torch_geometric.data.Data format suitable for graph convolutional network processing.
[0367] parameter:
[0368] graph(networkx.Graph): Cross-language hypergraph structure.
[0369] return:
[0370]
[0371]
[0372] This function converts the node information in the cross-language hypergraph structure constructed earlier into node features (here we simply use one-hot encoding to represent the language to which the node belongs as a feature, and in fact we can build a more reasonable representation method based on the specific semantic features), and organizes the edge connections into edge indexes. Finally, this information is integrated into data in the `torch_geometric.data.Data` format so that it can be subsequently input into the graph convolutional network for processing.
[0373] 4. Joint semantic mining based on graph convolutional networks to obtain benchmark bidirectional semantic association functions
[0374]
[0375] Based on graph convolutional networks, we conduct joint semantic mining on cross-language hypergraph structures and obtain benchmark bidirectional semantic associations.
[0376] parameter:
[0377] graph_data(torch_geometric.data.Data): The converted cross-language hypergraph structure data.
[0378] return:
[0379]
[0380] Here, we first define a simple graph convolutional network class `GCN`, which contains two convolutional layers. Then, in the `extract_base_associations` function, we pass the converted cross-language hypergraph structure data into the network for training (the number of training rounds, loss function, etc. are optimized according to actual conditions). After the training is completed, the Chinese and Mongolian word pairs with semantic associations are determined based on the node features output by the network (through cosine similarity and setting thresholds), and these word pairs are grouped into tuples and put into a list, which are returned as baseline bidirectional semantic associations.
[0381] 5. Propagate and mine the baseline bidirectional semantic association to supplement the bidirectional semantic association function
[0382] defpropagate_associations(base_associations):
[0383] The baseline bidirectional semantic associations are propagated, and Chinese and Mongolian words with indirect associations and semantically corresponding to each other are mined to generate supplementary bidirectional semantic associations.
[0384] parameter:
[0385] base_associations(list): A list of base bidirectional semantic associations.
[0386] return:
[0387]
[0388] This function receives a list of baseline bidirectional semantic associations as a parameter, and through propagation logic, searches for Chinese and Mongolian word pairs that can indirectly establish semantic associations through existing baseline associations, adds these newly discovered associations to the list, and returns them as supplementary bidirectional semantic associations, thereby expanding the scope of semantic associations.
[0389] 6. Align the baseline bidirectional semantic associations and supplementary bidirectional semantic associations to construct the Chinese-Mongolian semantic framework and the Chinese-Mongolian semantic framework function
[0390] defalign_associations(base_associations,supplemented_associations):
[0391] The baseline bidirectional semantic associations and the supplementary bidirectional semantic associations are aligned to construct the Chinese-Mongolian semantic framework and the Mongolian-Chinese semantic framework.
[0392] parameter:
[0393] base_associations(list): A list of base bidirectional semantic associations.
[0394] supplemented_associations(list): Supplemented bidirectional semantic association list.
[0395] return:
[0396]
[0397] This function merges the baseline bidirectional semantic associations and the supplementary bidirectional semantic associations together, and then traverses all associations to build a semantic mapping dictionary from Chinese to Mongolian (China-Mongolia semantic framework) and a semantic mapping dictionary from Mongolian to Chinese (Mongolian-China semantic framework). The keys of the dictionary are source language words, and the values are the corresponding target language word lists. In this way, the semantic associations are organized and standardized to facilitate subsequent semantic mapping operations.
[0398] 7. Main function call (there are already Chinese hypergraph network `chinese_graph` and Mongolian hypergraph network `mongolian_graph`)
[0399]
[0400] Optionally, the acquiring of the electric power text content expressed in the first language is matched with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language, wherein, when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese, including: performing electric power industry terminology feature word processing on the electric power text content expressed in the first language, and performing word vector annotation on the extracted electric power industry terminology feature words; performing syntactic analysis on the electric power text content expressed in the first language to determine the semantic dependency relationship between the annotated electric power industry terminology feature words; based on the semantic dependency relationship between the annotated electric power industry terminology feature words, matching the electric power text content expressed in the first language with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language. To this end, the above-mentioned acquisition of the power text content expressed in the first language is matched with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese. The specific technical processing process has the following technical benefits: 1. Focusing on key semantic elements: The power text content expressed in the first language is processed with power industry terminology feature words, and the most critical power industry related terms can be screened out from the complex text. Power texts often contain a large number of descriptive and modifying sentences, but the industry terms are the ones that truly carry the core power professional knowledge and semantics. For example, in the Chinese power text "The transformer in the substation ensures the stable operation of the transmission line by adjusting the voltage", the terms such as "substation", "transformer", and "transmission line" are key elements. After extracting these terminological feature words, we then annotate them with word vectors and convert them into numerical forms that are easy for computer processing and analysis, so that subsequent semantic similarity calculations, dependency analysis, and matching with bidirectional semantic mapping relationships can be more efficiently and accurately carried out around these key semantic elements, avoiding interference from irrelevant information and improving the accuracy and efficiency of the entire translation or semantic conversion process. 2. Mining latent semantic associations: The terminological feature words of the power industry after word vector annotating can reflect the latent semantic associations between them. In the vector space, the vector distances corresponding to terms with similar semantics are often close. For example, "generator" and "generator set" are related in meaning and closely related in function in the power field, and their word vectors are relatively close in space.Through this word vector annotation, we can use the distance, similarity and other metrics of the vector to explore the deep semantic connection between different terms in the power text, which is very helpful for accurately understanding the overall semantics of the power text and finding the most appropriate corresponding term translation or conversion when matching with the bidirectional semantic mapping relationship. It helps to more comprehensively sort out the internal relationship between different terms in the knowledge system of the power industry, thereby improving the accuracy and completeness of the semantic expression of the text after conversion from the first language to the second language. 3. Clarify the grammatical and semantic structure of the text: Perform syntactic analysis on the content of the power text expressed in the first language, determine the semantic dependency relationship between the annotated power industry terminology feature words, and clearly sort out the grammatical and semantic structure of the text. The power industry text usually has a more complex sentence structure, especially when it involves multiple power equipment, operating procedures and related parameter descriptions, the dependency relationship between the terms is intricate. For example, in the Mongolian power text "Трансформатор уранжолыг θθрчлθж байна (Transformer changes the transmission line)", through syntactic analysis it can be made clear that "Тран сформатор (transformer)" is the executor of the action, and "уран жолыг (transmission line)" is the object of the action, and there is a clear semantic dependency relationship between the two. This clear sorting of the structure helps to accurately grasp the meaning of the text, avoid translation errors caused by unclear grammatical understanding or confusion of semantic relationships, and lay a solid foundation for subsequent matching based on accurate semantic structure and bidirectional semantic mapping relationships. 4. Assist in accurately matching semantic mapping relationships; understanding the semantic dependency relationship between characteristic words of power industry terminology can provide important reference basis when matching with bidirectional semantic mapping relationships, and assist in more accurate matching operations. Although there are semantically corresponding power industry terms in different languages, their grammatical functions and dependencies in sentences may be different. For example, in Chinese, "transformer connects transmission line" may correspond to "Трансформатор уранжолыг холбосон" in Mongolian. Its word order and dependency structure will change according to Mongolian grammatical rules. By determining the semantic dependency of terms in the first language text through syntactic analysis, we can find the second language terms and expressions that can accurately correspond in semantics and grammatical functions in the two-way semantic mapping relationship, so as to generate circuit text content that conforms to the grammatical and semantic habits of the second language, improve the translation quality, and make the converted text more natural, smooth, and more in line with the expression norms of the target language. 5. Ensure accurate semantic conversion: Based on the semantic dependency between the marked power industry terminology feature words, the power text content expressed in the first language is matched with the two-way semantic mapping relationship, which can ensure the accuracy of semantics in the conversion process from the first language to the second language to the greatest extent.Although the bidirectional semantic mapping relationship establishes the corresponding connection between the terms in the power industry in different languages, the conversion based on the term correspondence alone may ignore the overall semantic structure and context of the text. When matching in combination with semantic dependencies, the role of each term in the original text and the relationship with other terms will be taken into account. For example, in a sentence expressing a causal relationship, the relevant power terms can also accurately reflect this causal semantics according to the habits of the target language during conversion, thereby avoiding the situation where the semantics are not smooth or the logic is unreasonable after word-to-word translation, and ensuring that the circuit text content expressed in the second language is semantically faithful to the original text and accurately conveys relevant information in the power industry. 6. Improve the naturalness and professionalism of the text: Through this matching method based on semantic dependencies, circuit text content that is more in line with the grammar and expression habits of the second language can be generated, which improves the naturalness and professionalism of the text. The power industry text has its own specific professional expression methods and industry standard terms. Different languages will follow their own language characteristics to organize sentences when describing the same power concept or operation. Considering semantic dependencies in the matching process can make the converted text present according to the normal word order, grammatical structure and collocation habits of professional terms in the target language, making it read more like a professional power text written by a native speaker, avoiding the stiff and unaccustomed translation tone. Whether it is used in technical exchanges, professional data translation or daily business exchanges between the China-Mongolia power industry, it can better meet the actual needs and promote effective communication and knowledge dissemination in the power industry in different language environments. 7. Adapt to diverse text scenarios: Power texts have diverse characteristics in content, sentence structure, style, etc., covering a variety of scenarios from simple equipment introduction to complex power system operation principle explanation, fault analysis, etc. The matching method based on semantic dependencies and bidirectional semantic mapping relationships can adapt well to such diverse text scenarios. Whether the text is a concise and clear description of power equipment parameters or a power technology paper with multiple clauses and complex logical relationships, the semantic dependencies of the terms can be accurately analyzed to find appropriate semantic mappings and expressions, ensuring high-quality conversion from the first language to the second language in various text types, and enhancing the applicability and processing capabilities of the entire power text translation or semantic conversion system for different practical application scenarios.
[0401] To this end, the above-mentioned acquisition of the electric power text content expressed in the first language is matched with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the specific technical processing process of the second language is Chinese, the exemplary code is as follows:
[0402] 1. Import necessary libraries
[0403] importjieba
[0404] importspacy
[0405] importgensim
[0406] importnumpyasnp
[0407] fromcollectionsimportdefaultdict
[0408] 2. Processing of power industry terminology feature words and word vector annotation function for power text content
[0409] defextract_and_vectorize_terms(text,term_dict_path,vector_model_path):
[0410] The power text content expressed in the first language (Chinese is taken as an example here) is processed with power industry terminology feature words, and the extracted power industry terminology feature words are annotated with word vectors.
[0411] parameter:
[0412] text(str): Input power text content.
[0413] term_dict_path(str): The file path that stores the power industry terminology dictionary, one term per line, used to extract feature words.
[0414] vector_model_path(str): Pre-trained word vector model file path (such as Word2Vec model).
[0415] return:
[0416]
[0417]
[0418] This function first reads the electric power industry terminology dictionary from the specified file path, and then loads the pre-trained word vector model (the `Word2Vec` model in the example). Then use `jieba` to segment the input electric power text content (for the Chinese case, if processing Mongolian, it needs to be replaced with a segmentation tool adapted to Mongolian), and extract the terms in the electric power industry terminology dictionary from the segmentation results as feature words. Finally, get the corresponding word vectors for these feature words (if the word is not in the model, simply use the zero vector as the default value), and return the result in the form of a tuple list containing the term and its word vector.
[0419] 3. Perform syntactic analysis on the power text content and determine the semantic dependency function (taking Chinese as an example, Mongolian needs to adapt to the corresponding language model)
[0420] defanalyze_syntax_and_dependencies(text):
[0421] The power text content expressed in the first language (here taking Chinese as an example) is subjected to syntactic analysis to determine the semantic dependency between the marked power industry terminology feature words.
[0422] parameter:
[0423] text(str): Input power text content.
[0424] return:
[0425]
[0426] This function uses the `spacy` library to load the corresponding language model (here we take Chinese as an example, and to process Mongolian, we need to load the appropriate Mongolian model) to perform syntactic analysis on the input text. It traverses each word in the analysis result to determine whether it is the feature word of the power industry terminology extracted previously. If so, it records the dependency type of the feature word and the dependent words (if any), takes the feature word as the key, and the dictionary containing the dependency relationship and dependent word information as the value, which is stored in `defaultdict` and returned, so as to determine the semantic dependency relationship between the feature words of the power industry terminology.
[0427] 4. Matching based on semantic dependencies to obtain the second language text content function (bidirectional semantic mapping relationship `bi_directional_mapping`)
[0428] defmatch_and_generate_text(feature_terms_vectors,dependencies,bi_directional_mapping):
[0429] Based on the semantic dependency relationship between the marked power industry terminology feature words, the power text content expressed in the first language is matched with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language.
[0430] parameter:
[0431] feature_terms_vectors(list): A list of tuples containing the power industry terminology feature words and their word vectors, in the format of [(term1, vector1), (term2, vector2), ...].
[0432] dependencies(defaultdict): A dictionary of semantic dependencies between annotated power industry terminology feature words, in the format of {term 1:{"dependency_relation":relation 1,"head_word":word 1}, term 2:{...},...}.
[0433] bi_directional_mapping(dict): Bidirectional semantic mapping relationship dictionary, the format is {language 1 term: [language 2 corresponding term 1, language 2 corresponding term 2,...],...}.
[0434] return:
[0435]
[0436] This function receives the previously obtained power industry terminology feature words and their word vector lists, semantic dependency dictionary, and bidirectional semantic mapping dictionary as parameters. It traverses the feature words and their vector lists, searches for the corresponding second language terms according to the bidirectional semantic mapping relationship, and forms a list of these translated terms. Then, it constructs the circuit text content expressed in the second language based on the semantic dependency relationship and returns it.
[0437] 5. Main function call (file path and bidirectional semantic mapping relationship data)
[0438]
[0439]
[0440] The embodiment of the present application also provides a device for translating electric power industry terms between Chinese and Mongolian based on artificial intelligence, which includes: a first program unit, used to construct a Chinese parallel forecast library and a Mongolian parallel corpus of electric power industry terms; a second program unit, used to generate a Chinese hypergraph network of electric power industry terms based on the Chinese parallel forecast library; a third program unit, used to generate a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel corpus; a fourth program unit, used to perform bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terms; the fourth program unit, used to obtain electric power text content expressed in a first language to match it with the bidirectional semantic mapping relationship to obtain circuit text content expressed in a second language, wherein, when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese.
[0441] The present application also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the present application. For exemplary explanations of the above-mentioned apparatus, storage medium, and electronic device, please refer to the above-mentioned Figure 1 Records of.< / nn> < / jj>
Claims
1. A method for translating power industry terms between Chinese and Mongolian based on artificial intelligence, characterized in that: include: Construct a Chinese parallel corpus and a Mongolian parallel corpus of power industry terminology; Based on the Chinese parallel prediction library, generating a Chinese hypergraph network of electric power industry terms; Based on the Mongolian parallel corpus, generating a Mongolian hypergraph network of electric power industry terms; Performing bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terminology; The electric power text content expressed in a first language is obtained to match the bidirectional semantic mapping relationship to obtain the circuit text content expressed in a second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese.
2. The method according to claim 1, characterized in that: The construction of the Chinese parallel corpus and the Mongolian parallel corpus of electric power industry terminology includes: Obtain Chinese and Mongolian subject description texts of the power industry; Performing text cleaning on the Chinese subject description text and the Mongolian subject description text of the power industry respectively to obtain the Chinese main body text and the Mongolian main body text; Based on the Chinese main text and the Mongolian main text, the Chinese parallel corpus and the Mongolian parallel corpus are constructed respectively.
3. The method according to claim 2, characterized in that: The step of constructing the Chinese parallel corpus and the Mongolian parallel corpus based on the Chinese main text and the Mongolian main text respectively includes: Performing word segmentation processing on the Chinese main text and the Mongolian main text respectively to obtain Chinese word segmentation and Mongolian word segmentation; Performing grammatical and syntactic analysis on the Chinese main text and the Mongolian main text respectively to obtain a grammatical description and a syntactic description of Chinese and a grammatical description and a syntactic description of Mongolian; Based on the Chinese word segmentation, the Chinese grammatical description and the syntactic description, a Chinese word sequence is formed to generate the Chinese parallel prediction library; Based on the Mongolian word segmentation, Mongolian grammatical description and syntactic description, a Mongolian word sequence is formed to generate the Mongolian parallel prediction library.
4. The method according to claim 3, characterized in that: The forming of a Chinese word sequence based on the Chinese word segmentation, the Chinese grammatical description and the syntactic description to generate the Chinese parallel prediction library includes: Based on the order of the Chinese segmented words in the Chinese topic description text, the Chinese segmented words are arranged in order to obtain a linear sequence of Chinese words; Determine the part-of-speech tag in the grammatical analysis result of the Chinese, and add it to the linear sequence of the Chinese words to obtain a Chinese part-of-speech injection sequence; Based on the syntactic analysis result of the Chinese, the syntactic component adjustment is performed on the Chinese part-of-speech injection sequence to generate a Chinese word sequence and generate the Chinese parallel prediction library accordingly; Forming a Mongolian word sequence based on the Mongolian word segmentation, Mongolian grammatical description and syntactic description to generate the Mongolian parallel prediction library includes: Arrange the Mongolian word segmentations in order based on the order of the Mongolian word segmentations in the Mongolian topic description text to obtain a Mongolian word linear sequence; Determine the part-of-speech tag in the Mongolian grammatical analysis result, and add it to the Mongolian word linear sequence to obtain a Mongolian part-of-speech injection sequence; Based on the syntactic analysis result of the Mongolian language, the syntactic components of the Mongolian language part-of-speech injection sequence are adjusted to generate a Mongolian language word sequence and the Mongolian language parallel prediction library is generated accordingly.
5. The method according to claim 3, characterized in that: The generating of a Chinese hypergraph network of electric power industry terminology based on the Chinese parallel forecast library comprises: Performing dependency annotation on the Chinese feature words in the Chinese parallel prediction library to obtain a Chinese word dependency tree; Based on the Chinese word dependency tree, mapping nodes and mapping hyperedges projected to the Chinese hypergraph network are determined to generate the Chinese hypergraph network.
6. The method according to claim 5, characterized in that The step of tagging the Chinese feature words in the Chinese parallel prediction library with dependencies to obtain a Chinese word dependency tree includes: Vectorize the Chinese professional terminology dictionary of the power industry to obtain the standard word vector of Chinese professional terminology in the power industry; Vectorize the Chinese amplified terms in the power industry to obtain the amplified word vectors of Chinese professional terms in the power industry; Performing cluster analysis on the standard word vectors of Chinese professional terms in the electric power industry and the expanded word vectors of Chinese professional terms in the electric power industry to obtain cluster center vectors under different semantic categories; According to the cluster center vectors under the different semantic categories, the Chinese feature words in the Chinese parallel prediction library are annotated with dependency relationships to obtain a Chinese word dependency tree.
7. The method according to claim 5, characterized in that The step of determining, based on the Chinese word dependency tree, mapping nodes and mapping hyperedges projected to the Chinese hypergraph network to generate the Chinese hypergraph network comprises: Determining word nodes in the Chinese word dependency tree, and performing semantic role annotation on the word nodes to determine the role of each word in the Chinese main text; According to the role of each word in the Chinese main text, mining the topic model in the Chinese word dependency tree to obtain a Chinese power topic vector; According to the Chinese power theme vector, the nodes to be mapped and the corresponding semantic dependency representations are screened out from the Chinese word dependency tree; The nodes to be mapped are projected into the Chinese hypergraph network to form the mapping nodes, and the semantic dependency representations are projected into the Chinese hypergraph network to form mapping hyperedges, so as to generate the Chinese hypergraph network.
8. The method according to claim 3, characterized in that: The method of generating a Mongolian hypergraph network of electric power industry terminology based on the Mongolian parallel prediction library includes: Performing dependency annotation on the Mongolian feature words in the Mongolian parallel prediction library to obtain a Mongolian word dependency tree; Based on the Mongolian word dependency tree, mapping nodes and mapping hyperedges projected to the Mongolian hypergraph network are determined to generate the Mongolian hypergraph network.
9. The method according to claim 8, characterized in that The step of tagging the Mongolian feature words in the Mongolian parallel prediction library with dependencies to obtain a Mongolian word dependency tree includes: Vectorize the Mongolian professional terminology dictionary of the power industry to obtain the standard word vector of Mongolian professional terminology in the power industry; Vectorize the Mongolian amplified terms in the power industry to obtain the amplified word vectors of Mongolian professional terms in the power industry; Performing cluster analysis on the standard word vectors of Mongolian professional terms in the electric power industry and the expanded word vectors of Mongolian professional terms in the electric power industry to obtain cluster center vectors under different semantic categories; According to the cluster center vectors under the different semantic categories, dependency annotation is performed on the Mongolian feature words in the Mongolian parallel prediction library to obtain a Mongolian word dependency tree.
10. A device for translating Chinese and Mongolian terms in the power industry based on artificial intelligence, characterized in that: include: The first program unit is used to construct a Chinese parallel corpus and a Mongolian parallel corpus of power industry terminology; A second program unit is used to generate a Chinese hypergraph network of electric power industry terms based on the Chinese parallel prediction library; A third program unit is used to generate a Mongolian hypergraph network of electric power industry terms based on the Mongolian parallel corpus; A fourth program unit is used to perform bidirectional semantic association on the Chinese hypergraph network and the Mongolian hypergraph network to establish a bidirectional semantic mapping relationship between Chinese words and Mongolian words of electric power industry terminology; The fourth program unit is used to obtain the power text content expressed in the first language to match it with the bidirectional semantic mapping relationship to obtain the circuit text content expressed in the second language, wherein when the first language is Chinese, the second language is Mongolian; when the first language is Mongolian, the second language is Chinese.
Citation Information
Cited By
Machine translation method and system based on large model fusion task disassembly and cognitive planning
CN120745656A