Low-resource language text translation method and device, electronic equipment and storage medium
By calculating the fractal difference parameters between the source and target languages and dynamically adjusting the adversarial generative network model, the problem of inaccurate translation results for low-resource languages is solved, and efficient translation quality improvement is achieved.
Patent Information
- Application Number
- CN202511065128.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-07
AI Technical Summary
In existing technologies, the translation results for low-resource languages are inaccurate and inefficient, mainly due to semantic distortion and translation efficiency issues caused by the scarcity of parallel corpora.
By obtaining the source language vector and target language vector of the sentence to be translated, the fractal difference parameters between the source language and the target language are calculated, the initial adversarial generative network model is dynamically adjusted, and the target adversarial generative network model is generated to adapt to the fractal structure of different languages and maintain temporal constraints, so as to output high-quality translation results.
It improves the translation quality and efficiency of low-resource languages, solves the problem of inaccurate translation results in low-resource languages, and accelerates the translation process.
Smart Images

Figure CN120911487A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a text translation method and device for low-resource languages, an electronic device and a storage medium. BACKGROUND
[0002] In the current process of globalization, machine translation technology has become an important bridge for cross-language communication.
[0003] Currently, when translating low-resource languages, a multilingual pre-training model, transfer learning method or existing adversarial network can be used to translate low-resource languages. However, parallel corpora corresponding to low-resource languages are relatively scarce, there is a semantic distortion problem caused by differences in the geometric structure of the language latent space, or in order to improve the translation quality of low-resource languages, the translation efficiency is sacrificed.
[0004] In order to solve the above problems, it is necessary to improve the text translation method for low-resource languages. SUMMARY
[0005] The present application provides a text translation method and device for low-resource languages, an electronic device and a storage medium to solve the problem of inaccurate translation results for low-resource languages due to the scarcity of parallel corpora in the prior art.
[0006] In a first aspect, the present application provides a text translation method for low-resource languages, comprising:
[0007] Obtaining a to-be-translated sentence corresponding to a source language, and determining a target sentence corresponding to the to-be-translated sentence from a pre-constructed target language monolingual corpus; wherein the source language is a low-resource language, and the target language monolingual corpus includes at least one text sentence corresponding to a target language;
[0008] Determining a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence;
[0009] Based on the to-be-used fractal difference parameter, dynamically adjusting an initial adversarial generative network model to obtain a target adversarial generative network model; wherein the initial adversarial generative network model includes a generator and a discriminator;
[0010] Based on the target adversarial generative network model, outputting a target translation sentence corresponding to the to-be-translated sentence.
[0011] In a second aspect, the present application also provides a text translation device for low-resource languages, comprising:
[0012] The target sentence determination module is configured to obtain a to-be-translated sentence corresponding to a source language, and determine a target sentence corresponding to the to-be-translated sentence from a pre-constructed monolingual corpus of a target language; wherein the source language is a low-resource language, and the monolingual corpus of the target language includes at least one text sentence corresponding to the target language.
[0013] The parameter determination module is configured to determine a fractal difference parameter to be used between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence.
[0014] The model adjustment module is configured to dynamically adjust an initial generative adversarial network model based on the fractal difference parameter to be used, to obtain a target generative adversarial network model; wherein the initial generative adversarial network model includes a generator and a discriminator.
[0015] The translated sentence output module is configured to output a target translated sentence corresponding to the to-be-translated sentence based on the target generative adversarial network model.
[0016] In a third aspect, an electronic device is provided, including:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the text translation method for a low-resource language according to any of the embodiments of the present application.
[0020] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text translation method for a low-resource language according to any of the embodiments of the present application when executed by the processor.
[0021] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program, and the computer program is used to implement the text translation method for a low-resource language according to any of the embodiments of the present application when executed by a processor.
[0022] The technical scheme of the embodiment of the application comprises the following steps: obtaining a to-be-translated sentence corresponding to a source language, and determining a target sentence corresponding to the to-be-translated sentence from a pre-constructed target language monolingual corpus; determining a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence; dynamically adjusting an initial generative adversarial network model based on the to-be-used fractal difference parameter to obtain a target generative adversarial network model; and outputting a target translation corresponding to the to-be-translated sentence based on the target generative adversarial network model. In the technical scheme, the to-be-used fractal difference parameter is estimated based on the source language vector corresponding to the to-be-translated sentence and the target language vector corresponding to the target sentence, so as to reflect the geometric fracture degree between the source language and the target language based on the to-be-used fractal difference parameter. Further, the initial generative adversarial network model is dynamically adjusted based on the to-be-used fractal difference parameter to obtain the target generative adversarial network model, so that the generator in the target generative adversarial network model can not only adapt to the fractal structure of different languages, but also retain the timing constraints required when generating the target language, while forcing the geometric alignment of the source language and the target language, thereby improving the translation quality of the target translation output based on the target generative adversarial network model. The problem that the translation result of the low-resource language is inaccurate due to the scarcity of parallel corpus of the low-resource language in the prior art is solved. Meanwhile, the hardware system carrying the target generative adversarial network model is accelerated, and the effects of improving the translation quality and translation efficiency of the low-resource language are achieved.
[0023] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0025] Figure 1 is a flowchart of a low-resource language text translation method provided by the first embodiment of the application;
[0026] Figure 2 is a flowchart of a low-resource language text translation method provided by the second embodiment of the application;
[0027] Figure 3 is a structural schematic diagram of a low-resource language text translation device provided by the third embodiment of the application;
[0028] Figure 4 Fig. 1 is a structural schematic diagram of an electronic device for implementing a low-resource language text translation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the technical personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the scope of protection of the present application. The acquisition, transmission, storage, use, processing and the like of data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, some industry existing solutions such as software, components or models may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0030] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0031] Embodiment one
[0032] Figure 1 A flowchart of a low-resource language text translation method is provided for the first embodiment of the present application. The present embodiment can be applicable to adjusting an initial adversarial generative network model based on cross-language fractal difference parameters between a source language and a target language to obtain a target adversarial generative network model, so as to improve translation quality and translation efficiency when the target adversarial generative network model is used to translate a low-resource language. The method can be executed by a low-resource language text translation device, which can be realized in the form of hardware and / or software, and can be configured in a computing device capable of executing the low-resource language text translation method.
[0033] As shown in Figure 1 , the method comprises:
[0034] S110, obtaining a to-be-translated sentence corresponding to a source language, and determining a target sentence corresponding to the to-be-translated sentence from a pre-constructed target language monolingual corpus.
[0035] The source language is a low-resource language. The so-called low-resource language refers to a language that lacks large-scale parallel corpus and mature language tool support. For example, a language with less than 100 million parallel corpus is referred to as a low-resource language. The so-called target language monolingual corpus refers to a large-scale pure text data set containing only target language text and no parallel alignment source language. In the technical solution, the target language monolingual corpus includes at least one text sentence corresponding to the target language.
[0036] The to-be-translated sentence refers to a text sentence of a low-resource language that needs to be translated. The target sentence refers to a text sentence corresponding to the target language retrieved from the target language monolingual corpus.
[0037] In the technical solution, the target sentence can be a text sentence that is semantically matched with the to-be-translated sentence in the target language, or a text sentence that has the same use scenario as the to-be-translated sentence in the target language. Optionally, determining the target sentence corresponding to the to-be-translated sentence from the pre-constructed target language monolingual corpus includes: randomly extracting a target sentence corresponding to the to-be-translated sentence in the same use scenario from the target language monolingual corpus; or retrieving a sentence with the highest similarity to the to-be-translated sentence from the target language monolingual corpus as the target sentence based on semantic similarity.
[0038] In actual application, the target sentence corresponding to the to-be-translated sentence can be determined according to the use scenario of the translation of the low-resource language and the standard of the translation quality.
[0039] For example, if the translation requirement of the low-resource language is only the similarity of the use scenario, and the fluency of the target translation sentence is required, and the semantic consistency is not emphasized, a target sentence corresponding to the to-be-translated sentence in the same use scenario can be randomly extracted from the target language monolingual corpus. At this time, the target sentence is a target language sentence that is fluent and has no grammatical errors, and has the same use scenario as the to-be-translated sentence.
[0040] If the semantic consistency of the to-be-translated sentence and the target translation sentence is emphasized, the target sentence should be as consistent as possible with the semantics of the to-be-translated sentence when the target sentence is determined from the target language monolingual corpus. In this process, the semantic similarity between the to-be-translated sentence and each sentence in the target language monolingual corpus can be calculated by a similarity algorithm, and the sentence with the highest similarity is taken as the target sentence.
[0041] S120, determining the to-be-used fractal difference parameter between the source language and the target language according to the source language vector corresponding to the to-be-translated sentence and the target language vector corresponding to the target sentence.
[0042] The source language vector refers to a vector after vector encoding of the sentence to be translated. The target language vector refers to a vector after vector encoding of the target sentence. The fractal difference parameter to be used refers to a cross-language fractal geometric difference parameter, which is used to quantify the complexity difference of the source language and the target language at multiple levels of scale in the language translation process, and reflects the information loss or structural change in the translation process.
[0043] Specifically, the sentence to be translated and the target sentence are respectively vector encoded to obtain a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence, and the fractal difference parameter to be used between the source language and the target language is calculated through the source language vector and the target language vector to analyze the fractal geometric difference between the source language and the target language.
[0044] In the technical solution, the source language vector can be understood as a vector of a latent space corresponding to the source language sentence, and the target language vector is a vector of a latent space corresponding to the target sentence. The so-called latent space can be understood as a special codebook for computer understanding of language, and different languages have different geometric shapes in the space. For example, the Chinese sentence "Hello" is converted into a coordinate composed of 768 numbers (such as [0.2, -1.3,...]).
[0045] Optionally, according to the source language vector corresponding to the sentence to be translated and the target language vector corresponding to the target sentence, the fractal difference parameter to be used between the source language and the target language is determined, including: inputting the sentence to be translated and the target sentence into a pre-constructed vector encoder to obtain a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence; based on the box counting method, the source language vector and the target language vector are calculated to obtain a first fractal dimension corresponding to the source language vector and a second fractal dimension corresponding to the target language vector; based on the first fractal dimension, the second fractal dimension, and the relative entropy between the source language and the target language, the fractal difference parameter to be used between the source language and the target language is determined.
[0046] In the technical solution, the manner of vector conversion of the sentence to be translated and the target sentence is not limited, that is, the vector encoder is not limited. For example, the vector encoder can be a pre-training language model (Bidirectional Encoder Representations from Transformers, BERT) model based on the architecture of the Transformer.
[0047] The first fractal dimension is used to describe the structural complexity of the source language vector at multiple scales. The second fractal dimension is used to describe the structural complexity of the target language vector at multiple scales. The relative entropy is used to measure the difference between the probability distributions of the source language and the target language, and reflects the information difference or uncertainty in the translation process.
[0048] In a specific example, the sentence to be translated X_s is input into the pre-constructed BERT model to obtain the latent space vector Z_s of the sentence to be translated (i.e., the source language vector). For example where 768 is the hidden layer dimension of the BERT model, and n is the sentence length of the sentence to be translated. For the target language, the target sentence is obtained from the pre-constructed monolingual corpus C_t of the target language, and the vector encoding of the target sentence is performed based on the BERT model to obtain the latent space vector Z_t of the target sentence (i.e., the target language vector), for example, where m is the sentence length of the target sentence.
[0049] On this basis, the first fractal dimension D(Z_s) corresponding to the source language vector and the second fractal dimension D(Z_t) corresponding to the target language vector are calculated based on the box counting method.
[0050] Taking the calculation of the first fractal dimension D(Z_s) corresponding to the source language vector based on the box counting method as an example, the specific steps are as follows:
[0051] a. Box size selection:
[0052] A series of decreasing box sizes ε are selected, such as ε = 0.1, 0.2, or 0.3, etc. For each box size ε, the minimum number of boxes N(ε) required to cover Z_s and Z_t is calculated.
[0053] b. Box coverage calculation: For each box size ε, traverse each position of Z_s and Z_t to determine whether the position is covered by the box. If a position is covered by a box, the box is counted as 1; otherwise, it is counted as 0. Count the number of boxes N(ε) with a count of 1 in all sizes of boxes.
[0054] c. Fractal dimension estimation:
[0055] According to the relationship between the number of boxes N(ε) and the box size ε, the first fractal dimension D_s is calculated:
[0056]
[0057] In actual calculation, since ε cannot be infinitely small, a number of ε values can be taken for linear fitting, and the slope is the estimated value of the fractal dimension D.
[0058] In general, in order to obtain an accurate fractal dimension estimate, multiple different box sizes need to be selected for calculation, such as ε = 0.1, 0.2, or 0.3, etc. In actual application, appropriate box size ranges can be selected according to actual requirements and computing resources.
[0059] Similarly, the target language vector is calculated to obtain a second fractal dimension D_t corresponding to the target language vector. In actual calculation, other appropriate box sizes can be selected as needed, and linear fitting is performed to obtain the estimated value of the fractal dimension, wherein the box size ε used in the calculation process of the source language vector and the target language vector can be the same or different.
[0060] Further, based on the first fractal dimension, the second fractal dimension, and the relative entropy (Kullback-Leibler divergence, KL divergence) between the source language and the target language, a fractal difference parameter to be used between the source language and the target language is obtained.
[0061] Specifically, the fractal difference parameter to be used can be calculated based on the following formula:
[0062] ΔD = tanh(|D_s - D_t|)·sigmoid(KL(P_s||P_t) / 5)
[0063] Wherein, ΔD represents the fractal difference parameter to be used, D_s represents the first fractal dimension, D_t represents the second fractal dimension, KL(P_s||P_t) represents the word frequency dispersion between the source language and the target language, the sigmoid function is compressed to [0, 1], and the tanh function is used to limit the fractal difference amplitude.
[0064] The advantage of such setting is that the fractal difference parameter to be used can reflect the degree of geometric fracture of the latent space of the source language and the target language, and serve as a core control variable for subsequent target adversarial generative network model.
[0065] S130, dynamically adjusting the initial adversarial generative network model based on the fractal difference parameter to be used to obtain a target adversarial generative network model.
[0066] Wherein, the adversarial generative network model refers to a deep learning model including a translation generator and a quality discriminator. The generator can automatically deform according to the fractal difference parameter to be used between the source language and the target language, and the discriminator can detect whether the geometric shape of the translation result meets the standard. The initial adversarial generative network model refers to an adversarial generative network model that has not been adjusted in parameters, and includes the generator and the discriminator in the initial adversarial generative network model. The target adversarial generative network model refers to a model that has been adjusted in parameters and can be used to translate the sentence to be translated into a translated sentence in the target language.
[0067] Specifically, the initial generative adversarial network model is dynamically adjusted based on the to-be-used fractal difference parameter to obtain a target generative adversarial network model, so as to translate the to-be-translated sentence into a target translation sentence based on the target generative adversarial network model. The adjustable parameters in the dynamic adjustment process include at least one of a hidden dimension parameter of the generator, a variable convolution kernel parameterization, and a causal mask matrix, and the adjusted model needs to be constrained by a topological consistency constraint condition after the dynamic adjustment parameter to obtain the target generative adversarial network model.
[0068] In S140, a target translation sentence corresponding to the to-be-translated sentence is output based on the target generative adversarial network model.
[0069] The target translation sentence refers to a translation result that is consistent with the semantics of the to-be-translated sentence and conforms to the rules of the target language.
[0070] Specifically, after the target generative adversarial network model is trained, the to-be-translated sentence is translated based on the generator in the target generative adversarial network model to obtain a translation result, and the quality of the translation result is judged based on the discriminator, and finally a target translation sentence corresponding to the to-be-translated sentence is output. The target translation sentence is consistent with the semantics of the to-be-translated sentence and conforms to the language rules of the target language.
[0071] In the technical solution, by calculating the to-be-used fractal difference parameter between the source language and the target language, when the system identifies that there is a significant fractal difference between the source language and the target language in the latent space, the network dimension of the generator can be automatically expanded like a telescopic lens, giving the model stronger feature analysis capability from a higher dimension, so that the cultural semantic details that are smoothed out by the rough network structure can be preserved. This dynamic adjustment directly affects the semantic projection process, and cultural-specific words are no longer forced to be mapped to the general concept area of the target language, but find the correct position like precise puzzle pieces, thereby significantly improving the cultural semantic fidelity of the translation result. At the same time,
[0072] The dynamic alignment of the geometric structure further triggers the collaborative optimization of the topological constraint mechanism. The to-be-optimized translation sentence output by the generator is no longer a scattered point in the target language latent space, but gradually forms a connected structure isomorphic to the target language through the guidance of the topological loss function, ensuring that the component connection mode of the sentence conforms to the grammar rules of the target language. Even when dealing with language pairs with extremely different forms, the translation result will not have component misplacement or structure rupture, fundamentally maintaining the coherence of the semantics and improving the translation quality.
[0073] Further, based on the mapping relationship between the fractal difference parameter to be used and the corresponding dynamic adjustable parameter of the generator, a piecewise linear function is generated; based on the piecewise linear function, the dynamic convolution kernel of the generator is optimized to accelerate the operation of the hardware system carrying the target generative adversarial network model.
[0074] On the basis of the above examples, the ΔD mapping table of the language pair is constructed offline:
[0075]
[0076] MurmurHash3 is a fast non-encryption hash function, and 10^6 is the number of hash table buckets;
[0077] Further, the hidden layer parameter d of the dynamic convolution kernel in the generator is accelerated through the piecewise linear function on the mobile terminal:
[0078]
[0079] By using piecewise approximation to avoid real-time calculation of Floor and ReLU functions, the calculation delay is reduced, and the dynamic convolution kernel Wd is calculated using CUDA WARP-level parallel computing, so that the single sentence delay is reduced.
[0080] The advantage of this setting is that, in order to meet the real-time requirement, the ΔD mapping table of the common language pair is pre-calculated in the offline stage, the ΔD value of all sentences in the training corpus is calculated, and the mean value is stored in the bucket according to the MurmurHash3 hash value. During online inference, the ΔD approximate value of the current sentence is retrieved within 3μs through the hash function. The dynamic dimension adjustment adopts piecewise linear approximation: when ΔD≤4, it is linearly expanded according to d=512+64ΔD; when ΔD is between 4 and 6, it is fixed at 768 dimensions; when ΔD>6, it is directly set to 1024 dimensions. Based on this, the interpolation calculation of the dynamic convolution kernel is realized through WARP-level parallelization on the GPU-the interpolation process of Wbase and ΔW is decomposed into parallel operation of 32 thread blocks, and the single sentence processing delay is controlled within 35ms, which realizes the acceleration of the hardware system carrying the target generative adversarial network model, improves the translation efficiency of the sentence to be translated, and achieves the effect of real-time translation.
[0081] The technical scheme of the embodiment of the present application comprises the following steps: obtaining a to-be-translated sentence corresponding to a source language, and determining a target sentence corresponding to the to-be-translated sentence from a pre-constructed monolingual corpus of a target language; determining a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence; dynamically adjusting an initial generative adversarial network model based on the to-be-used fractal difference parameter to obtain a target generative adversarial network model; and outputting a target translation corresponding to the to-be-translated sentence based on the target generative adversarial network model. In the technical scheme, the to-be-used fractal difference parameter is estimated based on the source language vector corresponding to the to-be-translated sentence and the target language vector corresponding to the target sentence, so as to reflect the geometric fracture degree between the source language and the target language based on the to-be-used fractal difference parameter. Furthermore, the initial generative adversarial network model is dynamically adjusted based on the to-be-used fractal difference parameter to obtain the target generative adversarial network model, so that the generator in the target generative adversarial network model can adapt to the fractal structure of different languages, can retain the timing constraints required when generating the target language, and can simultaneously force the geometric alignment of the source language and the target language, thereby improving the translation quality of the target translation output based on the target generative adversarial network model. The problem that the translation result of a low-resource language is inaccurate due to the scarcity of parallel corpus of the low-resource language in the prior art is solved. In combination with the acceleration of a hardware system carrying the target generative adversarial network model, the effect of improving the translation quality and translation efficiency of the low-resource language is achieved.
[0082] Embodiment two
[0083] Figure 2 A flowchart of a low-resource language text translation method provided by the second embodiment of the present application is provided. Optionally, the initial generative adversarial network model is dynamically adjusted based on the to-be-used fractal difference parameter to obtain the target generative adversarial network model.
[0084] As shown in Figure 2 , the method comprises the following steps:
[0085] In S210, a to-be-translated sentence corresponding to a source language is obtained, and a target sentence corresponding to the to-be-translated sentence is determined from a pre-constructed monolingual corpus of a target language.
[0086] In S220, a to-be-used fractal difference parameter between the source language and the target language is determined according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence.
[0087] In S230, at least one dynamically adjustable parameter of an initial generative adversarial network model is adjusted based on the to-be-used fractal difference parameter to obtain a to-be-constrained model.
[0088] The dynamic adjustable parameters include a hidden dimension parameter of the generator, a variable convolution kernel parameterization, and a causal mask matrix. The to-be-constrained model refers to an intermediate model in an optimized transition stage after the dynamic adjustable parameters of an initial generative adversarial network model are adjusted based on a fractal difference parameter to be used.
[0089] In a specific example, a hidden dimension parameter is obtained by dynamically expanding the hidden layer of the generator in the initial adversarial network parameter based on the fractal difference parameter to be used. Specifically, the hidden dimension parameter can be obtained by the following formula:
[0090]
[0091] where d represents the hidden dimension parameter, ReLU represents a nonlinear activation function, ΔD represents the fractal difference parameter to be used, represents rounding down.
[0092] When ΔD> 3, d = 1024, and when ΔD< 2, d = 512.
[0093] On this basis, a dynamic convolution kernel (i.e., variable convolution kernel parameterization) is inserted into the encoding layer of the generator, and the dynamic convolution kernel can be determined by the following formula:
[0094] W d =W base +ΔD·MLP(Flatten(W base ))
[0095] where W d represents the adjusted target weight, W base represents the reference weight, ΔD represents the fractal difference parameter to be used, MLP(·) represents a multi-layer perceptron for nonlinear transformation of the flattened parameter, and ΔD·MLP(·): the output of MLP is scaled by ΔD as a dynamic adjustment amount for the base parameter.
[0096] On this basis, a causal mask matrix M is added to the embedding layer of the generator for the characteristics of an agglutinative language:
[0097]
[0098] where M i,j may represent the (i, j)th element of the causal mask matrix, ΔD represents the fractal difference parameter to be used, I(·) represents an indicator function, represents rounding down ΔD.
[0099] Based on this, the generator in the initial generative adversarial network model is adjusted by the hidden dimension parameter, the variable convolution kernel parameterization, and the causal mask matrix to obtain the to-be-constrained model.
[0100] The advantage of this setup is that the generator's network structure adjusts in real time according to ΔD: the base hidden layer dimension is 512, and as ΔD increases (for example, ΔD often reaches 5.2 in Yi-English translation), it expands to a maximum of 1024 dimensions according to the formula d = 512 + ReLU(ΔD × 128 - 256). A deformable convolutional module is inserted into the Transformer encoding layer—the baseline convolutional kernel W_base is expanded into a vector, input into two fully connected layers (512 → 256 → 128, with GeLU activation function), and outputs the weight increment ΔW. The final dynamic convolutional kernel is W_d = W_base + ΔD × ΔW. Simultaneously, for the affix dependency characteristics of cohesive languages (e.g., some low-resource languages), a causal mask matrix is added to the decoder embedding layer: when ΔD > 3, the root word is allowed to interact with the affixes in the next three positions; when ΔD ≤ 2, only adjacent affixes are allowed to be associated. This dynamic adjustment allows the generator to adapt to the fractal structures of different languages while preserving the temporal constraints required for morphological generation.
[0101] S240. Based on the topological consistency constraint, the target adversarial generative network model is obtained by constraining the model to be constrained.
[0102] In this technical solution, based on topological consistency constraints, a target adversarial generative network model is obtained by constraining the model to be constrained. This includes: constructing a sequence of homology numbers to be used corresponding to the target language, and performing topological projection alignment on the generator based on the sequence of homology numbers to be used to obtain topological difference parameters corresponding to the model to be constrained; constraining the topological loss weight of the model to be constrained according to the product of the topological difference parameters and the fractal difference parameters to be used to obtain the model to be optimized, and outputting the optimized translation sentence corresponding to the sentence to be translated based on the optimized model; and optimizing the model to be optimized based on the translation quality corresponding to the optimized translation sentence to obtain the target adversarial generative network model.
[0103] The homology sequence to be used can be understood as an integer sequence describing the spatial topological features. It includes at least one Betti number, which can be used to sequentially quantify the number of "holes" (including connected components) in different dimensions of the space. The homology sequence includes at least one of the connected component parameters, independent loop structure parameters, and hole parameters of the target language latent space. The model to be optimized can be understood as an intermediate model in the process of converting the constrained model into a target adversarial generative network model. The translated sentence to be optimized refers to the translated sentence corresponding to the sentence to be translated, based on the output of the model to be optimized.
[0104] Specifically, a Vietoris-Rips complex of the target language vector Z_t is constructed, and a persistent homology Betti sequence (i.e., a homology sequence to be used) of the target language vector is calculated, the persistent homology Betti sequence β=(β_0,β_1,β_2), wherein β_0 represents a connected component parameter, β_1 represents an independent ring structure parameter, and β_2 represents a cavity parameter.
[0105] On this basis, the generator output G(X_s) is mapped to the homology space of Z_t to perform topological projection alignment on the to-be-constrained model. Wherein, the Betti number difference (i.e., a topological difference parameter) can be determined by the following formula:
[0106]
[0107] Wherein, L topo represents a topological difference parameter, represents the sum of 0-dimensional, 1-dimensional and 2-dimensional Betti numbers (β_0,β_1,β_2), covering low-dimensional topological features, represents the absolute difference of the i-dimensional Betti number, βi represents the i-dimensional topological feature, and the denominator adds (1e-5) to prevent division by zero.
[0108] On this basis, the topological loss weight is adjusted according to the to-be-used fractal difference parameter ΔD:
[0109]
[0110] Wherein, represents the final topological loss, ΔD represents the to-be-used fractal difference parameter, and L topo represents a topological difference parameter.
[0111] Wherein, the greater ΔD is, the higher the weight of the topological loss is.
[0112] Further, based on the translation quality corresponding to the to-be-optimized translation sentence, the to-be-optimized model is optimized to obtain a target adversarial generative network model, including: determining the adversarial loss gradient corresponding to the to-be-optimized model according to the semantic fluency of the to-be-optimized translation sentence, and determining the topological loss gradient corresponding to the to-be-optimized model based on the geometric alignment result corresponding to the to-be-optimized translation sentence; when the included angle between the adversarial loss gradient and the topological loss gradient is greater than a preset included angle, orthogonally projecting the adversarial loss gradient, until the weight of the topological loss gradient corresponding to the to-be-optimized translation sentence is less than a preset weight, to obtain the target adversarial generative network model.
[0113] Wherein, the adversarial loss gradient and the topological loss gradient are two key gradients for optimizing the generator parameters, and correspond to the adversarial loss and the topological loss of the generator, respectively.
[0114] In the technical solution, the adversarial loss is a loss function in the generative adversarial network for measuring the difference between the generated translation and the real translation, and the adversarial loss function can be represented by the following formula:
[0115]
[0116] Where D represents the discriminator, G represents the generator, p data is the distribution of real data, p z is the distribution of the input noise of the generator.
[0117] Where the adversarial loss gradient L adv is the gradient of the generator parameters with respect to the adversarial loss, and the adversarial loss gradient can be represented by the following formula:
[0118]
[0119] Where θ G is the parameter of the generator.
[0120] In practical applications, the adversarial loss gradient can be calculated by the backpropagation algorithm, which specifically includes: (1) forward propagation: calculating the generator output G(z) and the discriminator output D(G(z)); (2) calculating the loss: calculating the adversarial loss Ladv; (3) backpropagation: calculating the generator parameter θ G with respect to the adversarial loss gradient
[0121] In the technical solution, the topological loss function is a loss function for measuring the topological difference between the generated translation to be optimized and the target language latent space.
[0122] Where the topological loss gradient can be represented by the following formula:
[0123]
[0124] Where θ G is the parameter of the generator.
[0125] In practical applications, the topological loss gradient can also be calculated by the backpropagation algorithm, and the specific steps include: (1) forward propagation: calculating the Betti number β i (G) of the generator output G(z); (2) calculating the loss: calculating the topological loss L topo ; (3) backpropagation: calculating the generator parameter θ G with respect to the topological loss gradient
[0126] Further, the adversarial loss gradient is determined based on the following formula: the angle θ between the adversarial loss gradient and the topology loss gradient
[0127]
[0128] When the angle θ between the adversarial loss gradient and the topology loss gradient is greater than a preset angle, the adversarial loss gradient is orthogonally projected until the weight of the topology loss gradient corresponding to the to-be-optimized translation is less than a preset weight, and a target adversarial generation network model is obtained.
[0129] Specifically, the preset angle is defined as 90°, and if the angle θ between the adversarial loss gradient and the topology loss gradient is greater than 90°, the adversarial loss gradient is orthogonally projected as follows:
[0130]
[0131] wherein, represents the adversarial loss gradient after gradient orthogonalization, represents the original adversarial loss gradient, and represents the original topology loss gradient.
[0132] In this process, the orthogonal projection operation eliminates the component in that is in conflict with and retains the component in the orthogonal direction.
[0133] Further, the generator parameters are updated based on the following formula:
[0134]
[0135] wherein, the learning rate weight of the topology loss is increased by 0.1 every time ΔD is increased by 1.
[0136] wherein, the parameter θ G is the parameter of the generator, and specifically, θ G represents the set of all trainable parameters in the generator model. These parameters include but are not limited to: (1) weight matrix: parameters used for linear transformation, such as the weights of fully connected layers and convolutional layers; (2) bias vector: parameters used to adjust the output of linear transformation, usually used together with the weight matrix; (3) other trainable parameters: such as the mean and variance in Batch Normalization, etc.
[0137] The advantage of such setting is that in this step, the parameter θ G is used for gradient orthogonalization and dynamic learning rate adjustment to solve the gradient conflict between the adversarial loss and the topology loss and improve the stability and convergence speed of training. Specifically, by calculating the adversarial loss gradient And topological loss gradient And according to the orthogonal projection of the included angle between them, the gradient conflict can be eliminated, and the learning rate is adjusted dynamically according to Delta D, so that the model can better balance the optimization of adversarial loss and topological loss.
[0138] On this basis, after optimizing the generator, the optimization of the discriminator is also included, and the target adversarial generation network model is obtained.
[0139] Specifically, the Delta D factor is injected in the multi-head attention of the discriminator:
[0140]
[0141] Where, A f represents the dynamic attention matrix fused with fractal difference, QK T represents the standard attention score, Delta D represents the fractal difference parameter to be used, W g represents the fractal adjustment weight matrix, and d represents the attention head dimension.
[0142] Where, Delta D can be used as a gating coefficient to adjust the attention intensity, A f is output by the generator self-attention layer, W g is used to control the influence amplitude of Delta D on attention, and d is used to scale the dot product result.
[0143] On this basis, L1 penalty is applied to the abnormal area in the attention weight:
[0144]
[0145] Where, A std represents the standard attention weight without Delta D interference, A f [i,j]>0.2 represents an abnormally high attention area.
[0146] On this basis, the discriminator is updated, wherein the loss function of the discriminator can be represented by the following formula:
[0147] L D =L adv +0.5L attn
[0148] Where, L D represents the loss function of the discriminator, L adv represents the adversarial loss gradient, and L attn represents the attention deviation loss.
[0149] Where, the L attn is used to constrain the rationality of the dynamic attention matrix.
[0150] The advantage of such a setting is that the fractal perception ability is injected into the attention mechanism of the discriminator, and on the basis of the standard attention calculation , a trainable parameter matrix W g is added, and AD is used as a gating factor to adjust the attention weight. At the same time, abnormal regions in the attention weight are detected (for example, A f [i, j]>0.2 and the difference with the standard attention A std exceeds 2σ), and an L1 penalty term is applied to these regions. The final loss function of the discriminator includes the adversarial loss and the attention abnormality loss, and the latter accounts for 50%, forcing the discriminator to focus on the generation quality problem of the fractal fracture region.
[0151] S250, output the target translation sentence corresponding to the sentence to be translated based on the target adversarial generation network model.
[0152] The technical scheme of the embodiment of the application comprises the following steps: obtaining a sentence to be translated corresponding to a source language, and determining a target sentence corresponding to the sentence to be translated from a pre-constructed monolingual corpus of a target language; determining a fractal difference parameter to be used between the source language and the target language according to a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence; further adjusting at least one dynamically adjustable parameter of an initial adversarial generation network model based on the fractal difference parameter to be used to obtain a to-be-constrained model; and obtaining a target adversarial generation network model by constraining the to-be-constrained model based on a topological consistency constraint condition. In the technical scheme, the dynamically adjustable parameters of the initial adversarial generation network model are determined based on the fractal difference parameter to be used, wherein the dynamically adjustable parameters comprise a hidden dimension parameter of a generator, a variable convolution kernel number parameterization, and a causal mask matrix, and the to-be-constrained model is obtained by dynamically adjusting the dynamically adjustable parameters, so that the generator in the to-be-constrained model adapts to the fractal structure of different languages while retaining the timing constraints required for shape generation. Further, the target adversarial generation network model is obtained by topologically constraining the to-be-constrained model, so that the geometric alignment priority under high-dimensional difference is ensured when the target adversarial generation network model outputs the target translation sentence corresponding to the sentence to be translated, so as to focus more on topological constraints when the fractal difference is large and focus more on semantic fluency when the difference is small, thereby improving the translation accuracy of low-resource languages. The problem of inaccurate translation results of low-resource languages due to the scarcity of parallel corpora of low-resource languages in the prior art is solved, and the effect of improving the translation quality of low-resource languages is achieved.
[0153] Embodiment three
[0154] Figure 3 A structure schematic diagram of a low-resource language text translation device provided by the embodiment three of the application is shown in FIG. 3. Figure 3As shown, the apparatus comprises a target sentence determination module 310, a parameter determination module 320, a model adjustment module 330, and a translated sentence output module 340.
[0155] The target sentence determination module 310 is configured to obtain a to-be-translated sentence corresponding to a source language, and determine a target sentence corresponding to the to-be-translated sentence from a pre-constructed monolingual corpus of a target language; wherein the source language is a low-resource language, and the monolingual corpus of the target language includes at least one text sentence corresponding to the target language.
[0156] The parameter determination module 320 is configured to determine a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence.
[0157] The model adjustment module 330 is configured to dynamically adjust an initial generative adversarial network model based on the to-be-used fractal difference parameter to obtain a target generative adversarial network model; wherein the initial generative adversarial network model includes a generator and a discriminator.
[0158] The translated sentence output module 340 is configured to output a target translated sentence corresponding to the to-be-translated sentence based on the target generative adversarial network model.
[0159] The technical scheme of the embodiment of the present application comprises the following steps: obtaining a to-be-translated sentence corresponding to a source language, and determining a target sentence corresponding to the to-be-translated sentence from a pre-constructed monolingual corpus of a target language; determining a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence; dynamically adjusting an initial generative adversarial network model based on the to-be-used fractal difference parameter to obtain a target generative adversarial network model; and outputting a target translated sentence corresponding to the to-be-translated sentence based on the target generative adversarial network model. In the technical scheme, the to-be-used fractal difference parameter is estimated based on the source language vector corresponding to the to-be-translated sentence and the target language vector corresponding to the target sentence, so as to reflect the geometric fracture degree between the source language and the target language based on the to-be-used fractal difference parameter. Furthermore, the initial generative adversarial network model is dynamically adjusted based on the to-be-used fractal difference parameter to obtain the target generative adversarial network model, so that the generator in the target generative adversarial network model can adapt to the fractal structure of different languages, while retaining the timing constraints required for generating the target language, and simultaneously forcing the geometric alignment of the source language and the target language, thereby improving the translation quality of the target translated sentence output based on the target generative adversarial network model. The problem of inaccurate translation results for low-resource languages due to the scarcity of parallel corpora in the prior art is solved. Furthermore, the hardware system carrying the target generative adversarial network model is accelerated, thereby achieving the effects of improving the translation quality and translation efficiency for low-resource languages.
[0160] Optionally, the target sentence determining module comprises: a first submodule for randomly extracting a target sentence in the same use scenario as the sentence to be translated from the target language monolingual corpus; or
[0161] a second submodule for retrieving a sentence with the highest similarity to the sentence to be translated from the target language monolingual corpus based on semantic similarity as the target sentence.
[0162] Optionally, the parameter determining module comprises: a target language vector determining submodule for inputting the sentence to be translated and the target sentence into a pre-constructed vector encoder to obtain a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence;
[0163] a fractal dimension determining submodule for calculating the source language vector and the target language vector based on the box counting method to obtain a first fractal dimension corresponding to the source language vector and a second fractal dimension corresponding to the target language vector;
[0164] a parameter determining submodule for determining a fractal difference parameter to be used between the source language and the target language based on the first fractal dimension, the second fractal dimension, and the relative entropy between the source language and the target language.
[0165] Optionally, the model adjusting module comprises: a to-be-constrained model determining submodule for adjusting at least one dynamic adjustable parameter of the initial generative adversarial network model based on the fractal difference parameter to be used to obtain a to-be-constrained model; wherein the dynamic adjustable parameter comprises a hidden dimension parameter of the generator, a variable convolution kernel parameterization, and a causal mask matrix.
[0166] a model determining submodule for constraining the to-be-constrained model based on a topological consistency constraint condition to obtain a target generative adversarial network model.
[0167] Optionally, the model determining submodule comprises: a topological difference parameter determining unit for constructing a to-be-used homology number sequence corresponding to the target language, and performing topological projection alignment on the generator based on the to-be-used homology number sequence to obtain a topological difference parameter corresponding to the to-be-constrained model; wherein the to-be-used homology number sequence comprises at least one of a connected component parameter, an independent ring structure parameter, and a void parameter of the target language latent space;
[0168] a to-be-optimized translation determining unit for constraining a topological loss weight of the to-be-constrained model based on the product of the topological difference parameter and the fractal difference parameter to be used to obtain a to-be-optimized model, and outputting a to-be-optimized translation corresponding to the sentence to be translated based on the to-be-optimized model;
[0169] The model determining unit is configured to optimize the to-be-optimized model based on the translation quality of the to-be-optimized translation sentence to obtain the target generative adversarial network model.
[0170] Optionally, the model determining unit comprises a loss gradient determining subunit configured to determine the adversarial loss gradient corresponding to the to-be-optimized model according to the semantic fluency of the to-be-optimized translation sentence, and determine the topological loss gradient corresponding to the to-be-optimized model based on the geometric alignment result corresponding to the to-be-optimized translation sentence.
[0171] The model determining subunit is configured to perform orthogonal projection on the adversarial loss gradient when the included angle between the adversarial loss gradient and the topological loss gradient is greater than a preset included angle, and obtain the target generative adversarial network model when the weight of the topological loss gradient corresponding to the to-be-optimized translation sentence is less than a preset weight.
[0172] Optionally, the low-resource language text translation device is further configured to generate a piecewise linear function based on a mapping relationship between the to-be-used fractal difference parameter and the dynamic adjustable parameter corresponding to the generator, and optimize the dynamic convolution kernel of the generator based on the piecewise linear function to accelerate the operation of a hardware system carrying the target generative adversarial network model based on the dynamic convolution kernel.
[0173] The low-resource language text translation device provided in the embodiments of the present application can perform the low-resource language text translation method provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0174] Embodiment four
[0175] Figure 4 A structural schematic diagram of an electronic device 10 of an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the applications described and / or claimed in this document.
[0176] As Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0177] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0178] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the text translation method for low-resource languages.
[0179] In some embodiments, the text translation method for low-resource languages can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the text translation method for low-resource languages described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the text translation method for low-resource languages by any other appropriate means, such as by means of firmware.
[0180] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0181] Computer programs used to implement the low-resource language text translation methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program running on the processor implements the functions / operations specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine, or entirely on a remote machine or server.
[0182] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0183] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0184] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.
[0185] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0186] Embodiment Five
[0187] The embodiment of the application further provides a computer program product, comprising a computer program which, when executed by a processor, implements the text translation method of a low-resource language as provided in any embodiment of the application.
[0188] The computer program code can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce the computer implemented process such that the
[0189] It should be understood that various forms of flow shown above can be used, re-ordered, added to, or deleted from without departing from the spirit of the present application. For example, the steps recited in the present application can be performed in parallel, sequentially, or in different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0190] The specific embodiments have been shown and described for purposes of illustrating the embodiments, and not for purposes of limitation. It will be clear to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can be necessary, depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, combinations, sub-combinations and alternatives not described above are also included within the scope of the application.
Claims
1. A method for translating text in a low-resource language, the method comprising: The method comprises the following steps: acquiring a sentence to be translated corresponding to a source language, and determining a target sentence corresponding to the sentence to be translated from a pre-constructed monolingual corpus of a target language; wherein the source language is a low-resource language, and the monolingual corpus of the target language comprises at least one text sentence corresponding to the target language; determining a fractal difference parameter to be used between the source language and the target language according to a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence; dynamically adjusting an initial generative adversarial network model based on the fractal difference parameter to be used to obtain a target generative adversarial network model; wherein the initial generative adversarial network model comprises a generator and a discriminator; outputting a target translation corresponding to the sentence to be translated based on the target generative adversarial network model.
2. The method of claim 1, wherein, The method comprises the following steps: randomly extracting a target sentence in the same use scenario as the sentence to be translated from the monolingual corpus of the target language; or retrieving a sentence with the highest similarity to the sentence to be translated from the monolingual corpus of the target language as the target sentence based on semantic similarity.
3. The method of claim 1, wherein, The method comprises the following steps: inputting the sentence to be translated and the target sentence into a pre-constructed vector encoder to obtain a source language vector corresponding to the sentence to be translated and a target language vector corresponding to the target sentence; calculating the source language vector and the target language vector based on box counting method to obtain a first fractal dimension corresponding to the source language vector and a second fractal dimension corresponding to the target language vector; determining the fractal difference parameter to be used between the source language and the target language based on the first fractal dimension, the second fractal dimension, and the relative entropy between the source language and the target language.
4. The method of claim 1, wherein, The method comprises the following steps: adjusting at least one dynamically adjustable parameter of the initial generative adversarial network model based on the fractal difference parameter to be used to obtain a to-be-constrained model; wherein the dynamically adjustable parameter comprises a hidden dimension parameter of the generator, a variable convolution kernel parameterization, and a causal mask matrix; constraining the to-be-constrained model based on a topological consistency constraint condition to obtain the target generative adversarial network model.
5. The method of claim 4, wherein, The method comprises the following steps: construct a to-be-used homology number sequence corresponding to the target language, and perform topological projection alignment on the generator based on the to-be-used homology number sequence, to obtain a topological difference parameter corresponding to the to-be-constrained model; wherein the to-be-used homology number sequence comprises at least one of a connected component parameter, an independent ring structure parameter, and a cavity parameter of a latent space of the target language; constraining a topological loss weight of the to-be-constrained model according to a product of the topological difference parameter and the to-be-used fractal difference parameter, to obtain a to-be-optimized model, and outputting a to-be-optimized translation sentence corresponding to the to-be-translated sentence based on the to-be-optimized model; optimizing the to-be-optimized model based on a translation quality corresponding to the to-be-optimized translation sentence to obtain a target adversarial generative network model.
6. The method of claim 5, wherein, The method comprises the following steps: determining an adversarial loss gradient corresponding to the to-be-optimized model according to semantic fluency of the to-be-optimized translation sentence, and determining a topological loss gradient corresponding to the to-be-optimized model based on a geometric alignment result corresponding to the to-be-optimized translation sentence; when an included angle between the adversarial loss gradient and the topological loss gradient is greater than a preset included angle, orthogonally projecting the adversarial loss gradient, until a weight of the topological loss gradient corresponding to the to-be-optimized translation sentence is less than a preset weight, to obtain the target adversarial generative network model.
7. The method according to any of claims 1 to 6, characterized in that, The method further comprises the following steps: generating a piecewise linear function based on a mapping relationship between the to-be-used fractal difference parameter and a dynamic adjustable parameter corresponding to the generator; optimizing a dynamic convolution kernel of the generator based on the piecewise linear function, to accelerate operation of a hardware system carrying the target adversarial generative network model based on the dynamic convolution kernel.
8. A device for translating text in a low-resource language, characterized in that, The method comprises the following steps: a target sentence determination module is configured to acquire a to-be-translated sentence corresponding to a source language, and determine a target sentence corresponding to the to-be-translated sentence from a pre-constructed target language monolingual corpus; wherein the source language is a low-resource language, and the target language monolingual corpus comprises at least one text sentence corresponding to the target language; a parameter determination module is configured to determine a to-be-used fractal difference parameter between the source language and the target language according to a source language vector corresponding to the to-be-translated sentence and a target language vector corresponding to the target sentence; a model adjustment module is configured to dynamically adjust an initial adversarial generative network model based on the to-be-used fractal difference parameter, to obtain a target adversarial generative network model; wherein the initial adversarial generative network model comprises a generator and a discriminator; a translation sentence output module is configured to output a target translation sentence corresponding to the to-be-translated sentence based on the target adversarial generative network model.
9. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the low-resource language text translation method in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the low-resource language text translation method of any one of claims 1-7 when executed.