Chinese language translation method and system based on neural network model
Through the Chinese language translation method based on neural network model, combined with word segmentation clustering and text rhythm feature combination, the problems of language recognition bias and emotional attribute neglect in machine translation are solved, and high accuracy and high quality translation effects are achieved.
Patent Information
- Application Number
- CN202410814663.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-06-24
AI Technical Summary
When processing interactive information, existing machine translation technologies tend to cause deviations from the real input, and ignore the emotional attributes of speech, resulting in unsatisfactory translation accuracy.
The Chinese language translation method based on neural network model is adopted to accurately judge the language type of the source speech data through word segmentation clustering, and combine the text information and pronunciation information to determine the emotional attributes, thereby performing high-quality translation.
It improves the accuracy of language recognition of source speech data, enhances the semantic accuracy of translated text, and ensures the translation quality through iterative optimization, improving user experience.
Smart Images

Figure CN118747500B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a Chinese language translation method and system based on a neural network model. Background Art
[0002] Machine translation can automatically translate one natural language into another. Chinese language translation usually refers to translating Chinese into other languages, or vice versa. Currently, translation software can be used to recognize a piece of speech data, extract the original text and identify the language category, and then translate it by comparing the recognition result with the target language. However, since the interactive information carries various types of language information, there will be deviations between the recognition result and the actual input, and since the emotional attributes of speech are often ignored in the current translation process, the translation accuracy is not ideal. Summary of the invention
[0003] In order to solve at least one of the technical problems mentioned above, the present invention provides a Chinese language translation method and system based on a neural network model.
[0004] In a first aspect, the present invention provides a Chinese language translation method based on a neural network model, the method comprising:
[0005] Step S10, obtaining source voice data to be translated, and identifying the source voice data to obtain prosody information and text information;
[0006] Step S20, performing word segmentation processing on the text information to obtain a number of word segments; clustering the number of word segments, screening out the largest cluster and identifying the language type corresponding to the largest cluster as the language type of the source speech data;
[0007] Step S30, combining the text information and the prosody information to obtain a first combined feature and a second combined feature, and determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature;
[0008] Step S40: matching the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, translating the source voice data into a translation text in the target language based on the emotional attributes of the source voice data;
[0009] Step S50: Evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions;
[0010] Step S60: If not, return to execute steps S30-S50;
[0011] Step S70: If yes, obtain the final target translation text.
[0012] Preferably, the feature combination of the text information and the prosody information to obtain the first combined feature and the second combined feature includes:
[0013] S i XY =X i ×Y i T ;
[0014]
[0015] H i X* =(G i XY ×X i )X i ;
[0016] S i YX =Y i ×X i T ;
[0017]
[0018] H i Y* =(G i YX ×Y i )Y i ;
[0019] Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YX Represents the second combination information; ReLU() represents the ReLU function, G i XY represents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* Represents the second combined feature.
[0020] Preferably, determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature includes:
[0021] P X =tanh(wl A i X +b l );
[0022] P Y =tanh(w l A i Y +b l );
[0023] α X =softmax(P X );
[0024] α Y =softmax(P Y );
[0025] K i * =A i X α X T +A i Y α Y T ;
[0026] In the formula, A i X , A i Y are text-related weights and rhythm-related weights, tanh() is the tanh function, and w l , b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i * is the emotional attribute of the source speech data, and T represents the matrix transpose.
[0027] Preferably, before translating the source voice data into a translation text in a target language based on the emotional attributes of the source voice data, the method further includes:
[0028] Determine, based on the database, a glossary and context information related to the text information of the source voice data;
[0029] Match the term list with the word segmentation and clustering results to determine the target terms of the text information;
[0030] The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
[0031] In a second aspect, the present invention further provides a Chinese language translation system based on a neural network model, the system comprising:
[0032] A data recognition unit, used to obtain source speech data to be translated, and recognize the source speech data to obtain prosody information and text information;
[0033] A word segmentation processing unit is used to perform word segmentation processing on the text information to obtain a number of word segments; cluster the number of word segments, screen out the largest cluster and identify the language type corresponding to the largest cluster as the language type of the source speech data;
[0034] A feature combination unit, used to perform feature combination on the text information and the prosody information to obtain a first combined feature and a second combined feature, and determine the emotional attribute of the source speech data according to the first combined feature and the second combined feature;
[0035] A text translation unit, used to match the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, translate the source voice data into a translation text in the target language based on the emotional attributes of the source voice data;
[0036] The iterative optimization unit is used to evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions; if not, return to call the feature combination unit and the text translation unit; if so, obtain the final target translation text.
[0037] Preferably, the feature combination unit is used to perform feature combination on the text information and the prosody information to obtain a first combination feature and a second combination feature, including:
[0038] S i XY =X i ×Y i T ;
[0039]
[0040] H i X* =(G i XY ×X i )X i ;
[0041] S i YX =Y i ×X iT ;
[0042]
[0043] H i Y* =(G i YX ×Y i )Y i ;
[0044] Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YX Represents the second combination information; ReLU() represents the ReLU function, G i XY represents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* Represents the second combined feature.
[0045] Preferably, the feature combination unit is used to determine the emotional attribute of the source speech data according to the first combined feature and the second combined feature, including:
[0046] P X =tanh(w l A i X +b l );
[0047] P Y =tanh(w l A i Y +b l );
[0048] α X =softmax(P X );
[0049] α Y =softmax(P Y );
[0050] K i * =A i X α XT +A i Y α Y T ;
[0051] In the formula, A i X , A i Y are text-related weights and rhythm-related weights, tanh() is the tanh function, and w l 、b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i * is the emotional attribute of the source speech data, and T represents the matrix transpose.
[0052] Preferably, the text translation unit is further used for:
[0053] Determine, based on the database, a glossary and context information related to the text information of the source voice data;
[0054] Match the term list with the word segmentation and clustering results to determine the target terms of the text information;
[0055] The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
[0056] In a third aspect, the present invention further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.
[0057] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] 1) The present invention obtains source voice data to be translated, identifies the source voice data to obtain rhythm information and text information; performs word segmentation on the text information to obtain a number of word segments; clusters the several word segments, selects the largest cluster and identifies the language type corresponding to the largest cluster as the language type of the source voice data. For example, people in certain areas like to mix Chinese with English when sending voice, which will result in the inability to clearly distinguish the language type of the original voice during machine recognition. The present invention performs word segmentation and clustering on the text information, and uses the language type corresponding to the largest cluster as the language type of the source voice data. For example, if a voice contains 4 Chinese words and 2 English words, then the language type of the original data can be determined to be Chinese, which can greatly improve the accuracy of language recognition of the original data.
[0060] 2) During the translation process, the present invention first combines the text information and the prosodic information to obtain a first combined feature and a second combined feature, and determines the emotional attributes of the source voice data based on the first combined feature and the second combined feature; matches the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, the source voice data is translated into a translation text of the target language based on the emotional attributes of the source voice data. Since the influence of text features and prosodic features is taken into consideration, the emotional attributes of the voice sender can be accurately judged, thereby increasing the semantic accuracy of the translated text.
[0061] 3) After a translation is completed, the present invention will evaluate the translation quality of the translated text. When the evaluation result does not meet the preset conditions, it will return to execute the feature combination and translation process until the evaluation result of the translation quality meets the conditions, and the final target translation text is obtained. By using the preset conditions as the basis for judging the quality, and performing the iterative feature combination process when the quality does not meet the requirements, the target translation text with better quality can be finally obtained, which further ensures the accuracy of the translation and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0063] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0064] Figure 1 A schematic diagram of a process flow of a Chinese language translation method based on a neural network model provided by an embodiment of the present invention;
[0065] Figure 2A schematic diagram of the structure of a Chinese language translation system based on a neural network model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0068] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0069] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0070] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.
[0071] At present, in the process of machine translation, since the interactive information carries various types of language information, the recognition result will deviate from the real input, which will cause errors in the judgment of the language type of the original data. In addition, the emotional attributes of the speech are often ignored during the translation process, which leads to unsatisfactory translation accuracy. To this end, the present invention provides a Chinese language translation method based on a neural network model. The language type of the original data is first accurately judged based on word segmentation and clustering, which lays the foundation for the accuracy of the translation comparison relationship. The emotional attributes are determined by feature combination, and the influence of emotional attributes is considered during translation, which improves the accuracy of the translation semantics. After the translation, quality evaluation is performed, and iteration is performed when the quality is unqualified, which ensures the accuracy of the translated text and improves the user experience.
[0072] See also Figure 1 , Figure 1 The flowchart of the Chinese language translation method based on the neural network model provided by the embodiment of the present invention is as follows. Figure 1 As shown, the method comprises the following steps:
[0073] Step S10: Acquire source speech data to be translated, and recognize the source speech data to obtain prosody information and text information.
[0074] In this step, it is first necessary to collect source voice data through a microphone, a recording device or from an existing audio file to ensure that the voice signal is correctly captured. Since the collected original voice data may contain noise, it is necessary to remove background noise through noise reduction technology to improve the accuracy of subsequent processing. Preferably, preprocessing can be standardization of the voice signal, such as adjusting the volume, sampling rate, etc.
[0075] After obtaining an audio signal with high speech quality, the automatic speech recognition technology is used to convert the speech signal into a readable text format. This process not only recognizes the vocabulary content, but also retains the original semantics and grammatical structure as much as possible. In addition to text information, important factors that affect the semantics of speech expression also include prosodic information, such as speaking speed, intonation, pitch, pauses, stress, etc., which are crucial to maintaining the naturalness and emotional expression of the translated speech. Among them, the characteristics of the pitch, change and intensity of the tone can reflect the speaker's emotional state and tone, and the analysis of the speaking speed and volume can reveal the speaker's language rhythm and expression. Signal processing technology can analyze the source speech to extract these prosodic features. For example, the fundamental frequency (F0) can be used to represent the pitch change, and the energy distribution and duration information can be used to reflect the speaking speed and pauses. After completing the recognition of text information and prosodic information, the text information and prosodic information are integrated to form a comprehensive data structure, which is used as the data to be translated later. This data structure should be able to clearly reflect the semantics, grammar and prosodic characteristics of the original text.
[0076] Step S20: Perform word segmentation on the text information to obtain a number of segmented words; cluster the segmented words, select the largest clustering cluster, and identify the language type corresponding to the largest clustering cluster as the language type of the source speech data.
[0077] Performing word segmentation on text information is an important step in natural language processing, especially important when dealing with languages such as Chinese and Japanese that do not have clear word boundaries. The basic purpose of word segmentation is to split continuous text into word units with independent meanings for subsequent semantic analysis, machine translation, sentiment analysis, and other tasks. The following are the general steps of word segmentation processing:
[0078] 1) Preprocessing: Before formal word segmentation, first perform simple preprocessing on the text, such as removing irrelevant characters, such as punctuation marks, numbers, special symbols, etc., converting full-width characters to half-width, unifying case, etc., to reduce the complexity of word segmentation.
[0079] 2) Select a word segmentation method: Word segmentation methods can be roughly divided into several categories:
[0080] Dictionary-based word segmentation: This method relies on a large dictionary library and splits the text by matching the entries in the dictionary. When encountering words not in the dictionary, maximum matching, minimum matching, or other strategies may be used.
[0081] Statistical word segmentation: Use statistical methods to learn the frequency of word occurrences and context relationships, and dynamically determine the optimal segmentation method. This method has strong adaptability and can handle new words and technical terms well.
[0082] Hybrid word segmentation: Combine dictionary-based word segmentation, statistical methods, and possibly machine learning models to achieve more accurate word segmentation results.
[0083] Deep learning word segmentation: Based on deep learning methods, such as using models like LSTM for end-to-end training, the original text can be directly input and the word segmentation results can be output.
[0084] 3) Perform the word segmentation operation: Perform the actual word segmentation operation on the preprocessed text according to the selected word segmentation method. During the process, ambiguity problems may be encountered, that is, a string can have multiple segmentation methods. At this time, it is necessary to further judge the best segmentation scheme according to the context, language model, etc.
[0085] 4) Postprocessing: After word segmentation is completed, some postprocessing work may still be required, such as removing stop words like "de", "he", "zai", etc., which are common but contribute little to semantics, and part-of-speech tagging, etc., to better serve subsequent natural language processing tasks.
[0086] After obtaining several word segments, the next step is to determine the language type of the source voice data. It is understandable that people in different regions have different speaking habits. For example, people in some regions like to mix local languages with English when speaking, and there are also some scenarios where some users are learning a new foreign language, so there will be a mix of different languages. For example, the common language habit of users in Guangdong is "I have an appointment with a friend to have a party tomorrow at 15:00pm." This time, there will be a mix of Chinese, English, and Arabic numerals, and Cantonese expressions will often appear. At this time, in order to clearly distinguish the language type of the source voice data, the word segments of this sentence will be clustered, the largest cluster will be selected, and the language type corresponding to the largest cluster will be identified as the language type of the source voice data. For example, there are 2 English words, 1 Arabic numeral indicating time, and 4 Chinese word segments. Therefore, the source voice can be judged as Chinese, and the corresponding relationship of this translation is "Chinese-other languages"
[0087] In one embodiment, clustering the word segmentation results and identifying the language type includes:
[0088] 1) Feature extraction:
[0089] It is necessary to extract features from the word segmentation results to represent the words. For language identification, features may include but are not limited to:
[0090] Character n-grams: Use continuous sequences of characters (such as single-character, double-character, and triple-character sequences) as features.
[0091] Word frequency statistics: Count the frequency of each word and construct a word frequency vector.
[0092] Character distribution: Calculates the frequency of occurrence of each character or a specific combination of characters in a text.
[0093] Language Model: Features based on statistical language models such as n-grams.
[0094] 2) Clustering algorithm:
[0095] Select a suitable clustering algorithm and cluster the word segmentation results according to the extracted features. Common clustering algorithms include K-means, DBSCAN, spectral clustering, hierarchical clustering, etc. In this scenario, if the number of possible languages is known in advance, the K-means algorithm is preferred; if the number of languages is unknown and the data distribution is complex, DBSCAN or spectral clustering is usually more appropriate.
[0096] 3) Filter the largest cluster and identify the language type:
[0097] After running the clustering algorithm, identify the largest cluster based on the size of the cluster (i.e. the number of words it contains). This cluster should theoretically represent the most important language features in the text;
[0098] Furthermore, to identify the language corresponding to the largest cluster, the following strategies can be adopted:
[0099] Prior knowledge matching: If a list of possible languages is known, matching can be performed using a distance metric or a probabilistic model by comparing the features of the largest cluster with typical features of known languages.
[0100] Training model: Use a multilingual corpus to train a classifier, such as a support vector machine, by inputting the feature vector of the largest cluster and outputting the predicted language label.
[0101] Feature comparison: Analyze the keywords or specific language features (such as special characters, common word roots, etc.) in the largest cluster, and directly compare and identify them with the features of known languages.
[0102] Finally, the recognized languages are verified, either by manual inspection or by using techniques such as cross-validation to assess the accuracy of clustering and recognition.
[0103] Therefore, this embodiment uses steps S10 and S20 to identify text information and perform word segmentation and clustering, and uses the language type corresponding to the largest cluster as the language type of the source speech data. For example, if a speech contains 4 Chinese words and 2 English words, then the language type of the original data can be determined to be Chinese, which can greatly improve the accuracy of language recognition of the original data.
[0104] Step S30: Combine the text information and the prosody information to obtain a first combined feature and a second combined feature, and determine the emotional attributes of the source speech data according to the first combined feature and the second combined feature.
[0105] Before combining features, feature extraction is required first:
[0106] Text information feature extraction:
[0107] Word-level features: including word frequency, part-of-speech tags, vocabulary richness, word embedding, etc.
[0108] Syntactic features: sentence length, dependency relations, syntactic structure, etc.
[0109] Semantic features: Use word vector models or deep learning models to obtain the semantic representation of sentences.
[0110] Prosodic information feature extraction:
[0111] Syllable and phoneme features: such as syllable count and syllable intensity distribution.
[0112] Tonal features: prosodic units such as syllables, fundamental frequency contours of words, and pitch changes.
[0113] Duration features: duration of words and syllables, pause time.
[0114] Stress characteristics: stress position and intensity.
[0115] After extracting the features, feature combination is required. By extracting the interactive combination information between the text features and the rhythmic features, we can obtain the text-based text-rhythm interactive combination features and the rhythm-based rhythm-text interactive combination features. This interactive combination feature extraction can more comprehensively capture the relationship and interaction between text and rhythm.
[0116] In one embodiment, the feature combination of the text information and the prosody information to obtain the first combined feature and the second combined feature includes:
[0117] S i XY =X i ×Y i T ;
[0118]
[0119] H i X *=(G i X Y×X i )X i ;
[0120] S i YX =Y i ×X i T ;
[0121]
[0122] H i Y* =(G i YX ×Y i )Y i ;
[0123] Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YXRepresents the second combination information; ReLU() represents the ReLU function, G i XY represents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* Represents the second combined feature.
[0124] Therefore, this embodiment can more comprehensively express the relationship between text and rhythm through the interactive combination of features, so as to better capture the expression details of the language, so that the model can more delicately understand the emotional color, context and speaker's intention of the text when processing tasks, thereby improving the accuracy of emotion recognition.
[0125] In one embodiment, determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature includes:
[0126] P X =tanh(w l A i X +b l );
[0127] P Y =tanh(w l A i Y +b l );
[0128] α X =softmax(P X );
[0129] α Y =softmax(P Y );
[0130] K i * =A i X α X T +A i Y α Y T ;
[0131] In the formula, A i X , A i Y are text-related weights and rhythm-related weights, tanh() is the tanh function, and wl , b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i * is the emotional attribute of the source speech data, and T represents the matrix transpose.
[0132] In this embodiment, the importance of text and rhythm can be dynamically adjusted through text-related weights and rhythm-related weights, so as to more accurately capture the relationship between text and rhythm. By obtaining the text hidden state and the rhythm hidden state and performing s0ftmax normalization on them, their contributions in the fusion process can be made more balanced, avoiding a certain feature from dominating. By superimposing and fusing the text weight vector and the rhythm weight vector, combined with the first combined feature and the second combined feature, multiple representations of text and rhythm can be fused together to determine the emotional attributes of the source speech data. In this way, it is helpful to extract more expressive features, such as information containing multiple dimensions of text and rhythm, thereby improving the accuracy and performance of sentiment analysis.
[0133] Step S40: Match the language type of the source voice data with the language type of the target language. When the language type of the source voice data is different from the language type of the target language, translate the source voice data into a translation text in the target language based on the emotional attributes of the source voice data.
[0134] Before translation, you need to first determine the translation correspondence, that is, "Chinese-other" or "other-Chinese". Through language type matching, when it is determined that the language type of the source voice data is different from the language type of the target language, the corresponding translation correspondence can be determined, so as to translate the current source voice data into the desired target language.
[0135] In one embodiment, before translating the source voice data into a translation text in a target language based on the emotional attributes of the source voice data, the method further includes:
[0136] Determine, based on the database, a glossary and context information related to the text information of the source voice data;
[0137] Match the term list with the word segmentation and clustering results to determine the target terms of the text information;
[0138] The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
[0139] In the process of text translation, in order to improve the quality of text translation, in addition to ensuring the consistency of the overall translation and sentence expression, the context description of the text translation must also be consistent. It is also necessary to ensure that the text to be translated is translated in the same context to achieve consistency in the overall style of the text translation. The translation obtained by only paying attention to one aspect often cannot meet actual usage needs.
[0140] Specifically, to determine the glossary and contextual information related to the text information of the source speech data, term extraction is usually required, that is, using natural language processing (NLP) techniques such as named entity recognition (NER), keyword extraction or topic modeling to extract important terms and vocabulary from text information. In order to understand the meaning of the terms, it is necessary to analyze the context in which they appear. This can be achieved through context analysis, co-occurrence analysis or dependency parsing. The extracted terms are then organized into a table or list, and each term is provided with information such as definition, synonyms, antonyms, related terms, etc. to complete the creation of the glossary. Finally, through context information integration, the contextual information related to each term is integrated into the glossary to better understand and explain the usage and meaning of the term.
[0141] Furthermore, the word segmentation clustering results are matched with the term list. The word segmentation clustering results are often more colloquial. By matching with the term list that takes into account the contextual semantics, the exact meaning expressed by the text information segmentation can be accurately grasped to obtain the target term that accurately represents the meaning of the text information. Finally, the target term, text information and context information are input into the pre-trained language analysis model. Through the integration of the language analysis model, the target text information to be translated can be obtained.
[0142] Therefore, this embodiment integrates the text information to be translated, takes into account the glossary and context information, and can quickly output the processed target text information through the language analysis model, thereby improving the quality of the text before translation and laying the foundation for the accuracy of subsequent translation.
[0143] Step S50: Evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions;
[0144] Step S60: If not, return to execute steps S30-S50;
[0145] Step S70: If yes, obtain the final target translation text.
[0146] After a translation is completed, this embodiment will evaluate the translation quality of the translated text. When the evaluation result does not meet the preset conditions, it will return to execute the feature combination and translation process until the evaluation result of the translation quality meets the conditions, thereby obtaining the final target translation text.
[0147] In one embodiment, when evaluating the translation quality, the original text information before translation and the translated text information after translation can be spliced to obtain the spliced text, and then the original text features and the translated text features are obtained by feature extraction, and the original text features and the translated text features are combined to obtain the fusion features, and then the fusion features are further split and reorganized to obtain the target translation features, and finally the target translation features are input into the score prediction model, which can identify the target translation features and thus evaluate the translation quality. In this way, through this feature splicing, separate extraction, fusion and reorganization method, the score prediction model can be combined to quickly and accurately evaluate the translation quality. Since the feature processing is refined, the training difficulty of the score prediction model can be reduced.
[0148] This embodiment uses preset conditions as the basis for judging quality, and performs an iterative feature combination process when the quality does not meet the requirements, and can ultimately obtain a target translation text with better quality, further ensuring the accuracy of the translation and greatly improving the user experience.
[0149] In summary, the Chinese language translation method based on the neural network model provided by the embodiment of the present invention can first determine the language type of the source speech data through word segmentation processing and word segmentation clustering, so as to accurately identify the translation correspondence and prevent the problem of mistranslation of language types. The emotional attributes are determined by combining the features of text information and rhythmic information, thereby increasing the semantic accuracy of the translated text. After the translation is completed, the translation quality is evaluated. When the evaluation result does not meet the preset conditions, the feature combination and translation process are returned until the evaluation result of the translation quality meets the conditions, and the final target translation text is obtained, which further ensures the accuracy of the translation and improves the user experience.
[0150] See also Figure 2 In some embodiments, the present invention further provides a Chinese language translation system based on a neural network model, the system comprising:
[0151] The data recognition unit 100 is used to obtain source speech data to be translated, and recognize the source speech data to obtain prosody information and text information;
[0152] The word segmentation processing unit 200 is used to perform word segmentation processing on the text information to obtain a number of word segments; cluster the number of word segments, select the largest cluster and identify the language type corresponding to the largest cluster as the language type of the source speech data;
[0153] A feature combination unit 300 is used to perform feature combination on the text information and the prosody information to obtain a first combined feature and a second combined feature, and determine the emotional attribute of the source speech data according to the first combined feature and the second combined feature;
[0154] A text translation unit 400 is used to match the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, translate the source voice data into a translation text in the target language based on the emotional attribute of the source voice data;
[0155] The iterative optimization unit 500 is used to evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions; if not, return to call the feature combination unit and the text translation unit; if so, obtain the final target translation text.
[0156] In some embodiments, the feature combination unit 300 is used to perform feature combination on the text information and the prosody information to obtain a first combination feature and a second combination feature, including:
[0157] S i XY =X i ×Y i T ;
[0158]
[0159] H i X* =(G i XY ×X i )X i ;
[0160] S i YX =Y i ×X i T ;
[0161]
[0162] H i Y* =(G i YX ×Y i )Y i ;
[0163] Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YX Represents the second combination information; ReLU() represents the ReLU function, G i XYrepresents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* Represents the second combined feature.
[0164] In some embodiments, the feature combination unit 300 is used to determine the emotional attribute of the source speech data according to the first combined feature and the second combined feature, including:
[0165] P X =tanh(w l A i X +b l );
[0166] P Y =tanh(w l A i Y +b l );
[0167] α X =softmax(P X );
[0168] α Y =softmax(P Y );
[0169] K i * =A i X α X T +A i Y α Y T ;
[0170] In the formula, A i X , A i Y are text-related weights and rhythm-related weights, tanh() is the tanh function, and w l 、b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i* is the emotional attribute of the source speech data, and T represents the matrix transpose.
[0171] In some embodiments, the text translation unit 400 is further configured to:
[0172] Determine, based on the database, a glossary and context information related to the text information of the source voice data;
[0173] Match the term list with the word segmentation and clustering results to determine the target terms of the text information;
[0174] The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
[0175] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.
[0176] The present invention also provides an electronic device, comprising: a processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.
[0177] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.
[0178] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0179] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
[0180] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0181] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0183] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0184] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Claims
1. A Chinese language translation method based on a neural network model, characterized in that: The method comprises: step S10, obtaining source speech data to be translated, and identifying the source speech data to obtain prosody information and text information; Step S20, performing word segmentation processing on the text information to obtain a number of word segments; clustering the number of word segments, screening out the largest cluster and identifying the language type corresponding to the largest cluster as the language type of the source speech data; Step S30, combining the text information and the prosody information to obtain a first combined feature and a second combined feature, and determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature; The feature combination of the text information and the rhythm information to obtain the first combination feature and the second combination feature includes: S i XT =X i ×Y i T H i X* =(G i XY ×X i )X i S i YX =And i ×X i T H i Y* =(G i YX ×Y i )Y i Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YX Represents the second combination information; ReLU() represents the ReLU function, G i XY represents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* represents the second combined feature; The step of determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature comprises: P X =tanh(w l A i X +b l ) P Y =tanh(w l A i Y +b l ) α X =softmax(P X ) α Y =softmax(P Y ) K i * =A i X a X T +A i Y a Y T Where tanh() is the tanh function, w l 、b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i * is the emotional attribute of the source speech data, T represents the matrix transpose; Step S40: matching the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, translating the source voice data into a translation text in the target language based on the emotional attributes of the source voice data; Step S50: Evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions; Step S60: If not, return to execute steps S30-S50; Step S70: If yes, obtain the final target translation text.
2. The Chinese language translation method based on the neural network model according to claim 1 is characterized in that: Before translating the source voice data into a translation text in a target language based on the emotional attributes of the source voice data, the method further includes: Based on the database, determine the term list and context information related to the text information of the source voice data; match the term list with the word segmentation and clustering results to determine the target term of the text information; The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
3. A Chinese language translation system based on a neural network model, characterized in that: The system comprises: a data recognition unit, which is used to obtain source speech data to be translated, and recognize the source speech data to obtain prosody information and text information; A word segmentation processing unit is used to perform word segmentation processing on the text information to obtain a number of word segments; cluster the number of word segments, screen out the largest cluster and identify the language type corresponding to the largest cluster as the language type of the source speech data; A feature combination unit, used to perform feature combination on the text information and the prosody information to obtain a first combined feature and a second combined feature, and determine the emotional attribute of the source speech data according to the first combined feature and the second combined feature; The feature combination of the text information and the rhythm information to obtain the first combination feature and the second combination feature includes: S i XY =X i ×Y i T H i X* =(G i XY ×X i )X i S i YX =And i ×X i T H i Y* =(G i YX ×Y i )Y i Where, X i is the i-th text feature, Y i is the prosodic feature corresponding to the i-th text feature, T represents the matrix transpose; S i XY Represents the first combination information, S i YX Represents the second combination information; ReLU() represents the ReLU function, G i XY represents the relevance score of the first combination of information, G i YX represents the relevance score of the second combination of information; H i X* represents the first combination feature, H i Y* represents the second combined feature; The step of determining the emotional attribute of the source speech data according to the first combined feature and the second combined feature comprises: P X =tanh(w l A i X +b l ) P Y =tanh(w l A i T +b l ) α X =softmax(P X ) α Y =softmax(P Y ) K i * =A i X a X T +A i Y a Y T Where tanh() is the tanh function, w l 、b l are the weight and bias of the fully connected layer, l is the index of the layer; P X , P Y are the text hidden state and the rhythm hidden state respectively, α X , α Y are the text weight vector and the rhythm weight vector respectively, softmax() is the softmax function, K i * is the emotional attribute of the source speech data, T represents the matrix transpose; A text translation unit, used to match the language type of the source voice data with the language type of the target language, and when the language type of the source voice data is different from the language type of the target language, translate the source voice data into a translation text in the target language based on the emotional attributes of the source voice data; The iterative optimization unit is used to evaluate the translation quality of the translated text and determine whether the evaluation result meets the preset conditions; if not, return to call the feature combination unit and the text translation unit; if so, obtain the final target translation text.
4. The Chinese language translation system based on the neural network model according to claim 3 is characterized in that: The text translation unit is further used for: Determine, based on the database, a glossary and context information related to the text information of the source voice data; Match the term list with the word segmentation and clustering results to determine the target terms of the text information; The target term, text information and context information are input into the pre-trained language analysis model to obtain the target text information to be translated.
5. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions. When the processor executes the computer instructions, the electronic device executes the Chinese language translation method based on the neural network model as described in any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the Chinese language translation method based on a neural network model as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Emotional voice translation device and processing method
CN101937431A
Speech translation method and system using multilingual text-to-speech synthesis model
CN111566656A