CN113723116B - Text translation method and related device, electronic equipment and storage medium - Google Patents

Text translation method and related device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113723116B
CN113723116B CN202110982411.5A CN202110982411A CN113723116B CN 113723116 B CN113723116 B CN 113723116B CN 202110982411 A CN202110982411 A CN 202110982411A CN 113723116 B CN113723116 B CN 113723116B
Authority
CN
China
Prior art keywords
word
text
representation
semantic
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110982411.5A
Other languages
Chinese (zh)
Other versions
CN113723116A (en
Inventor
张为泰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology of China USTC
iFlytek Co Ltd
Original Assignee
University of Science and Technology of China USTC
iFlytek Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology of China USTC, iFlytek Co Ltd filed Critical University of Science and Technology of China USTC
Priority to CN202110982411.5A priority Critical patent/CN113723116B/en
Publication of CN113723116A publication Critical patent/CN113723116A/en
Application granted granted Critical
Publication of CN113723116B publication Critical patent/CN113723116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Abstract

The application discloses a text translation method, a related device, electronic equipment and a storage medium, wherein the text translation method comprises the following steps: acquiring a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, a plurality of reference texts are expressed in a target language, and each reference text contains the ambiguous words; extracting first semantic representations of ambiguous words in the text to be translated, and respectively extracting second semantic representations of paraphrasing words in each reference text; based on the clustering results of the first semantic representation and the second semantic representation, acquiring translation words of the ambiguous words in the text to be translated, which are interpreted in the target language; and translating the text to be translated based on the translation words to obtain the translation text expressed in the target language. By the aid of the scheme, translation accuracy can be improved.

Description

Text translation method and related device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of natural language processing technologies, and in particular, to a text translation method and related device, electronic device, and storage medium.
Background
Machine translation is a process of converting text to be translated in a source language into a target language using a computer. Over decades, machine translation has been greatly improved from rule-based to statistics-based to the current neural network-based, with advances and developments.
At present, the machine translation based on the neural network has better effects on common sentences and words under the addition of massive parallel corpus and large models. However, in the face of ambiguities, ambiguities that are continually given new meaning, particularly in human social activities, are poorly translated, or even compromised. In view of this, how to improve translation accuracy is a problem to be solved.
Disclosure of Invention
The technical problem that this application mainly solves is to provide a text translation method and relevant device, electronic equipment, storage medium, can improve translation accuracy.
In order to solve the above technical problems, a first aspect of the present application provides a text translation method, including: acquiring a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, a plurality of reference texts are expressed in a target language, and each reference text contains the ambiguous words; extracting first semantic representations of ambiguous words in the text to be translated, and respectively extracting second semantic representations of paraphrasing words in each reference text; based on the clustering results of the first semantic representation and the second semantic representation, acquiring translation words of the ambiguous words in the text to be translated, which are interpreted in the target language; and translating the text to be translated based on the translation words to obtain the translation text expressed in the target language.
In order to solve the above technical problem, a second aspect of the present application provides a text translation device, including: the system comprises a text acquisition module, a semantic extraction module, a semantic clustering module and a language translation module, wherein the text acquisition module is used for acquiring a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, a plurality of reference texts are expressed in a target language, and each reference text contains the ambiguous words; the semantic extraction module is used for extracting first semantic representations of ambiguous words in the text to be translated and extracting second semantic representations of paraphrasing words in each reference text respectively; the semantic clustering module is used for acquiring translation words of the ambiguous words in the target language in the text to be translated based on the clustering results of the first semantic representation and the second semantic representation; and the language translation module is used for translating the text to be translated based on the translation words to obtain the translation text expressed in the target language.
In order to solve the above technical problem, a third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, where the memory stores program instructions, and the processor is configured to execute the program instructions to implement the text translation method in the first aspect.
In order to solve the above technical problem, a fourth aspect of the present application provides a computer readable storage medium storing program instructions executable by a processor, where the program instructions are configured to implement the text translation method in the above first aspect.
According to the scheme, the text to be translated and a plurality of reference texts are obtained, the text to be translated is represented in a source language, the text to be translated contains ambiguous words, the plurality of reference texts are represented in a target language, each reference text contains the ambiguous words of the ambiguous words, on the basis, the first semantic representation of the ambiguous words in the text to be translated is extracted, the second semantic representation of the ambiguous words in each reference text is extracted, on the basis of the clustering result of the first semantic representation and the second semantic representation, the translation words of the ambiguous words in the target language are obtained, on the basis, the text to be translated is translated based on the translation words, the translation text to be translated is obtained, the translation text expressed in the target language is obtained, therefore, the first semantic representation of the ambiguous words in the text to be translated in the source language is represented by describing the ambiguous words, the second semantic representation of the ambiguous words in the reference text of the target language is clustered on the basis, the first semantic representation and the second semantic representation are accurately judged, on the basis, the translation of the ambiguous words in the target language is translated, on the basis, the translation text to be translated can be translated in the target language is accurately, the translation words can be translated, the translation effect can be greatly improved, and the translation effect can be obviously is obviously interfered.
Drawings
FIG. 1 is a flow diagram of one embodiment of a text translation method of the present application;
FIG. 2 is a process diagram of one embodiment of a text translation method of the present application;
FIG. 3 is a schematic diagram of a framework of one embodiment of a semantic extraction model;
FIG. 4 is a schematic diagram of a framework of one embodiment of a text translation device of the present application;
FIG. 5 is a schematic diagram of a frame of an embodiment of an electronic device of the present application;
FIG. 6 is a schematic diagram of a framework of one embodiment of a computer readable storage medium of the present application.
Detailed Description
The following describes the embodiments of the present application in detail with reference to the drawings.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship. Further, "a plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a flow chart illustrating an embodiment of a text translation method of the present application.
Specifically, the method may include the steps of:
step S11: and acquiring the text to be translated and a plurality of reference texts.
In the embodiment of the disclosure, the text to be translated is expressed in a source language, the text to be translated contains ambiguities, a plurality of reference texts are expressed in a target language, and each reference text contains the ambiguous words.
In one implementation scenario, the specific languages of the source language and the target language may be set according to the actual application requirements. For example, in a Chinese-to-English scenario, the source language may be Chinese and the target language may be English; alternatively, in the mid-translation day scenario, the source language may be chinese and the target language may be japanese. Other scenarios may be so, and are not exemplified here.
In one implementation scenario, the ambiguous word contains several kinds of sense items, and each reference text may contain a paraphrase of one of the sense items. Taking the example of a Chinese-to-English scenario, for the polysomnography "millet" it contains two sense terms, one meaning term representing annual herbs of Gramineae Setaria, the other meaning term representing millet company, the paraphrasing term "millet" for the first sense term and "Xiaomi" for the second sense term. Other scenarios may be so, and are not exemplified here.
In one implementation scenario, to maximize translation, paraphrasing words in several reference texts may cover all of the paraphrasing terms of the ambiguities. Still taking the polysomnography "millet" as an example, the text to be translated may be of interest for "millet planning for the next 10 years. The set of paraphrasing words in each reference text may cover all the paraphrasing terms of the polysthesis word "millet", as may include, but is not limited to, the following reference text: "I like to eat millet and noodles", "Buy me a Xiaomi mobile phone", etc., are not limited herein. Other scenarios may be so, and are not exemplified here. According to the method, the ambiguous words contain a plurality of kinds of meaning items, and the meaning-releasing words in the plurality of reference texts cover the plurality of kinds of meaning items, so that the method can be beneficial to determining the translation words of the ambiguous words in the target language in the text to be translated from the meaning-releasing words corresponding to all the meaning items, and is beneficial to improving the translation effect.
In one implementation scenario, please refer to fig. 2 in combination, fig. 2 is a process schematic diagram of an embodiment of the text translation method of the present application. As shown in fig. 2, to facilitate text translation, an ambiguous word repository may be pre-constructed, which may include several ambiguities, each containing a plurality of ambiguities and paraphrasing words for each of the ambiguities in the target language. Still taking the example of a Chinese-to-English scenario, as previously described, some words tend to be given new connotations with human social activity, e.g., the polysemous knowledge base may include, but is not limited to, the polysemous terms: millet, rice flour, etc., wherein the meaning of the polysemous word "millet" and its paraphrasing words are as described previously, and the meaning of the polysemous word "rice flour" includes millet product vermicelli (paraphrasing words are Mifan) and feature snacks (paraphrasing words are vermicelli). In addition, a monolingual database can be constructed, and the monolingual database contains candidate texts, wherein each candidate text contains any one of ambiguous words represented by the source language and paraphrasing words represented by the target language. Taking the polysemous word "millet" as an example, candidate text may include, but is not limited to: "millet is an internet company", "I like to eat millet and noodles", "Buy me aXiaomi mobile phone", "millet is a staple food" and the like, without limitation. In this case, the paraphrasing words of the ambiguities can be searched in the ambiguous word knowledge base based on the ambiguities in the text to be translated, and the reference text can be retrieved in the monolingual database according to the paraphrasing words of the ambiguities. With continued reference to fig. 2, taking the ambiguous word "millet" in the text to be translated "the coming 10 years of planning is focused on" as an example, the ambiguous words "Xiaomi" and "millet" of the ambiguous word can be found in the ambiguous word knowledge base, and on the basis of this, the reference text containing the ambiguous words "Xiaomi" and "millet" can be retrieved in the monolingual database: "I like to eat millet and noodles", "Buy me a Xiaomi mobile phone". Other situations can be similar and are not exemplified here.
In one implementation scenario, as shown in fig. 2, several reference texts may also be represented in a target language, or in a source language, and the reference texts may contain paraphrasing words of ambiguities, or may contain ambiguities themselves. That is, candidate text containing ambiguous words and their paraphrased words may also be retrieved directly in the monolingual database as reference text.
It should be noted that, when no ambiguous word is detected in the text to be translated, the text to be translated may be directly translated to obtain the translated text expressed in the target language.
In one implementation scenario, word segmentation processing can be performed on a text to be translated to obtain a plurality of word segments of the text to be translated, for each word segment, the word segment itself, a first combination word of the word segment and adjacent word segments, and a second combination word of the first combination word and adjacent word segments can be used as words to be retrieved, whether the words to be retrieved exist is retrieved in the polysemous word knowledge base, if so, the presence of polysemous words in the text to be translated is indicated, otherwise, the absence of polysemous words in the text to be translated is indicated. Taking the text to be translated, namely 'the attention of the people who plan the millet for 10 years in the future', as an example, the text to be translated can be subjected to word segmentation processing to obtain the following word segmentation: "millet", "future", "10", "year", "planning", "receiver", "attention", and "small" are words, and "millet", "millet future 10 years", etc. may be taken as words to be searched, and other words may be similarly deduced to obtain words to be searched, which will not be repeated herein. On the basis, whether the word to be searched exists or not can be searched in the polysemous word knowledge base, the fact that the word to be searched 'millet' exists in the polysemous word knowledge base can be determined through searching, and then the fact that the polysemous word 'millet' exists in the text to be translated can be determined. Other situations can be similar and are not exemplified here.
In one implementation scenario, in order to improve the translation efficiency, a translation model may be trained in advance, so that the text to be translated may be translated directly by using the translation model to obtain the translation text expressed in the target language under the condition that the ambiguous word is not detected in the text to be translated. In particular, the translation model may include, but is not limited to: openNMT, tf-seq2seq, etc., without limitation herein. For specific translation procedures, reference may be made to technical details concerning machine translation models such as OpenNMT, tf-seq2seq, etc., which are not described in detail herein.
Step S12: first semantic representations of ambiguous words in the text to be translated are extracted, and second semantic representations of paraphrasing words in each reference text are extracted respectively.
In one implementation scenario, a plurality of word segments of an input text can be obtained, the word segments comprise target words, on the basis of semantic information of the target words and reference words thereof, word semantic representations of the target words can be obtained, the reference words comprise word segments positioned before and/or after the target words, in the process, when the input text is a text to be translated, the target words are polysemous words, the word semantic representations are first semantic representations, and when the input text is the reference text, the target words are paraphrase words, and the word semantic representations are second semantic representations. According to the method, the word semantic representation of the target word is obtained through the semantic information of the target word and the semantic information of the reference word, so that the word sequence information and the grammar structure of the input text can be modeled, and the reference word is the word segmentation before and/or after the target word, namely the word segmentation adjacent to the position of the target word, and the word segmentation adjacent to the position has a stronger semantic relation, so that the accuracy of the word semantic representation is improved.
In a specific implementation scenario, the input text may be segmented by a segmentation tool, so as to obtain a plurality of segmented words of the input text. In particular, the word segmentation tools may include, but are not limited to: the resultant article, hanLP, snowNLP, etc., is not limited herein.
In a specific implementation scenario, the reference word may include at least one of a preceding word of the target word and a following word of the target word, which is not limited herein.
In a specific implementation scenario, to improve semantic extraction efficiency, a neural network may be used to extract word semantic representations. The neural network may specifically include, but is not limited to: bi-LSTM (Bi-directional Long Short-terminal Memory, two-way long and short Term Memory network), and the like, without limitation. It should be noted that, in the case of Bi-LSTM, for the target word, on one hand, one semantic representation may be obtained by referring to its own semantic information and the semantic information of a word preceding the target word, and on the other hand, one semantic representation may be obtained by referring to its own semantic information and the semantic information of a word following the target word, and then the two semantic representations may be spliced to obtain the word semantic representation of the target word. In addition, in order to further extract deep semantics, in the case of using Bi-LSTM, the neural network may include multiple layers (e.g., 2 layers, 3 layers, etc.) of Bi-LSTM, after the Bi-LSTM of the ith layer extracts the semantic representation of the word of each segment, for each segment, in the processing of the Bi-LSTM of the (i+1) th layer, a semantic representation of the (i+1) th layer may be obtained based on the semantic representation of the word extracted by itself at the (i) th layer and the semantic representation of the word extracted by the previous segment at the (i) th layer, and a semantic representation of the (i+1) th layer may be obtained based on the semantic representation of the word extracted by itself at the (i) th layer and the semantic representation of the word extracted by the subsequent segment at the (i+1) th layer, and then the semantic representations of the (i+1) th layer may be spliced to obtain the semantic representation of the word of each segment output at the (i+1) th layer. Other situations can be similar and are not exemplified here.
In one implementation scenario, a plurality of word segments of an input text can be obtained, the plurality of word segments comprise target words, and on the basis of the attention weights of the plurality of word segments on the target words, word semantic representations of the target words are obtained, in the process, when the input text is a text to be translated, the target words are polysemous words, the word semantic representations are first semantic representations, and when the input text is a reference text, the target words are paraphrased words, and the word semantic representations are second semantic representations. According to the method, the attention weights of the target words are respectively given to the plurality of word segments, so that the word semantic representation of the target words is obtained, the relation between the target words and the word segments at other positions can be captured as large as possible, the semantic features of the target words are enhanced, and the accuracy of the word semantic representation is improved.
In one specific implementation scenario, the attention weights of the plurality of segmented words to the target word respectively may be obtained based on an attention mechanism. In particular, the attention mechanism may include, but is not limited to: self-attention), and the like, without limitation. For a specific acquisition procedure of the attention weight, reference may be made to technical details of an attention mechanism such as a self-attention mechanism, and details thereof will not be described herein.
In a specific implementation scenario, the attention weights of the target words can be respectively used for weighting the word semantic representations of the plurality of segmented words so as to update the word semantic representations of the target words. It should be noted that, the word semantic representation of several word segments may be obtained through a pre-training language model such as BERT (Bidirectional Encoder Representation from Transformers, i.e., the Encoder representation of the bidirectional transducer), and the specific obtaining process may refer to the pre-training language model such as BERT, which is not described herein. In addition, in order to extract deep semantics, a multiple-attention mechanism can be adopted to continuously mine semantic relations between the target words and each word segment. Specifically, after the ith attention mechanism, the word semantic representation of each word segment can be obtained, when the ith attention mechanism is used for the (i+1) th attention mechanism, the attention weight of each word segment to the word segment can be obtained for each word segment, the attention weight of each word segment is utilized to carry out weighted processing on the word semantic representation extracted by each word segment after the ith attention mechanism, so as to update and obtain the word semantic representation of the word segment after the (i+1) th attention mechanism, and so on until the last attention mechanism, the last attention mechanism can be called as the nth attention mechanism for convenience of description, the word semantic representation of each word segment after the nth attention mechanism can be obtained, and the word semantic representation of the target word after the nth attention mechanism can be obtained and used as the final word semantic representation of the target.
In a specific implementation scenario, in the case that the word is a break, the attention weight of the word to the target word is lower than a preset threshold. Specifically, the preset threshold may be set according to actual situations, for example, in a case where no reference is needed for an article, the attention weight of the article to the target article may be directly set to 0; alternatively, in the case where appropriate reference is required to the article, the preset threshold may be set to 0.1, 0.05, 0.01, or the like, which is not limited herein. It should be noted that the term "virtual" refers to a word having no actual meaning, such as "in", "about", etc. words in the text, or such as "in", "of", "on", etc. words in the text. According to the method, under the condition that the segmented word is the virtual word, the attention weight of the segmented word to the target word is set to be lower than the preset threshold value, so that the influence of the virtual word on the semantic meaning of the target word can be reduced as much as possible, and the semantic meaning accuracy is improved.
In one implementation scenario, a plurality of word segments of an input text can be obtained, the word segments comprise target words, on the basis of semantic information of the target words and reference words thereof, first word representation of the target words can be obtained, second word representations of the target words can be obtained based on attention weights of the word segments to the target words respectively, the reference words comprise word segments positioned before and/or after the target words, and the first word representations and the second word representations are fused to obtain fused semantic representations of the target words. According to the method, on one hand, the first word representation of the target word is obtained through the semantic information of the target word and the semantic information of the reference word, so that the word sequence information and the grammar structure of the input text can be modeled, meanwhile, the reference word is the word before and/or after the target word, namely, the word adjacent to the position of the target word is referred, the word adjacent to the position has a stronger semantic relation, so that the accuracy of the first word representation is improved, on the other hand, the second word representation of the target word is obtained through the attention weights of a plurality of word segments to the target word respectively, the relation between the target word and other word segments at all positions can be captured as large as possible, the semantic characteristics of the target word are enhanced, the accuracy of the second word representation is improved, and on the basis, the accuracy of the fusion semantic representation can be improved through the fusion of the first word representation and the second word representation respectively extracted at the two aspects.
In a specific implementation scenario, the specific process of extracting the first word list based on the semantic information of the target word and the reference word thereof may refer to the foregoing related description, which is not repeated herein.
In a specific implementation scenario, the attention weights of the target words can be respectively weighted by using the plurality of segmentation words to obtain the second word representation, and the attention weights of the segmentation words to the target words are lower than a preset threshold value under the condition that the segmentation words are the virtual words. Reference may be made specifically to the foregoing related description, and details are not repeated here.
In a specific implementation scenario, in order to enhance the language features, identification characters may be further included in several word segments, where the identification characters are used to represent the language in which the text is entered. For example, when the input text is represented in english, the identification character "EN" may be included in a number of words of the input text to represent english languages, or when the input text is represented in chinese, the identification character "ZH" may be included in a number of words of the input text to represent chinese languages. Other situations can be similar and are not exemplified here. According to the method, the identification characters are arranged in the plurality of segmented words and used for representing languages adopted by the input text, so that language characteristics of the input text can be enhanced in the semantic extraction process.
In a specific implementation scenario, a first weighting factor of the first word representation and a second weighting factor of the second word representation can be obtained based on the correlation between the first word representation and the second word representation, and on the basis, the first word representation and the second word representation are respectively weighted by the first weighting factor and the second weighting factor to obtain a fusion semantic representation. Specifically, the degree of correlation between the first word representation and the second word representation may be obtained by a dot product operation between the two. For ease of description, the first word representation may be denoted as h 1 The second word is denoted h 2 The first weighting factor may be expressed as:
G1=h 1 *h 2 T ……(1)
in the above formula (1), T represents a transpose, and the second weighting factor G2 can be calculated from 1-G1. On the basis of this, it can be represented by G1 1 +G2*h 2 And (5) calculating to obtain the product. In the above manner, based on the correlation between the first word representation and the second word representation, the first weighting factor of the first word representation and the second weighting factor of the second word representation are obtained, and the first word representation and the second word representation are weighted by the first weighting factor and the second weighting factor respectively, so as to obtain the fusion semantic representation, so that the word tables respectively acquired from two dimensions can be referenced to different degrees The word representation accuracy of the target word is improved.
In one implementation scenario, referring to fig. 2 in combination, the first semantic representation and the second semantic representation may be represented in vector form. The specific dimensions of the vector are not limited herein, and may be 128-dimensional, 256-dimensional, 512-dimensional, etc., as not limited herein.
In one implementation scenario, as shown in fig. 2, in order to improve extraction efficiency of semantic representations, a semantic extraction model may be trained in advance, and on this basis, a first semantic representation of a text to be translated and a second semantic representation of a reference text may be respectively extracted by using the semantic extraction model. The specific training process of the semantic extraction model can refer to the following disclosure embodiments, which are not described herein.
In a specific implementation scenario, please refer to fig. 3 in combination, fig. 3 is a schematic diagram of a framework of an embodiment of a semantic extraction model. As shown in fig. 3, the semantic extraction model includes a first semantic extraction network, a second semantic extraction network, and a semantic fusion network, and the semantic fusion network is used for fusing word representations respectively extracted by the first semantic extraction network and the second semantic extraction network. The first semantic extraction network is specifically used for obtaining first word representation of the target word based on semantic information of the target word and reference words thereof, the second semantic extraction network is specifically used for obtaining second word representation of the target word based on attention weights of a plurality of segmentation words to the target word respectively, and the semantic fusion network is specifically used for fusing the first word representation and the second word representation to obtain fused semantic representation of the target word. According to the method, the semantic extraction model comprises the first semantic extraction network, the second semantic extraction network and the semantic fusion network, the semantic fusion network is used for fusing word representations respectively extracted by the first semantic extraction network and the second semantic extraction network, namely, the word representations can be extracted through cooperation of the first semantic extraction network, the second semantic extraction network and the semantic fusion network, and the extraction efficiency of the word representations is improved.
In a specific implementation scenario, please continue to refer to fig. 3, the first semantic extraction network may include multiple layers (e.g., two layers, three layers, etc.) of BiLSTM (i.e., two-way long-short-term memory network), the second semantic extraction network may include multiple layers (e.g., two layers, three layers) of attention mechanism networks (e.g., self-attention mechanism network), and the specific meanings of the two-way long-short-term memory network and the attention mechanism network may refer to the technical details of both respectively, which will not be described herein. The semantic fusion network is used for fusing the first word representation and the second word representation, and specifically can refer to the foregoing formula (1) and related description thereof, and will not be described herein. As shown in fig. 3, planning for the next 10 years with the text "millet" to be translated is of interest. "for example, its several segmentations may include: the identification characters "ZH", the word segment w1 "millet", the word segment w2 "future", … …, the word segment wn. The word vector of the above word segmentation is obtained specifically through a pre-training language model such as BERT, which is not described herein. After that, the word vectors of the plurality of segmented words are input into a first semantic extraction network and a second semantic extraction network to be processed, the first word representation of each segmented word can be obtained through the processing of the first semantic extraction network, the second word representation of each segmented word can be obtained through the processing of the second semantic extraction network, and on the basis, the first word representation and the second word representation of each segmented word can be fused based on a semantic fusion network to obtain the fused semantic representation of the segmented word. On this basis, a first semantic representation of the polysomnography "millet" in the text to be translated can be obtained. The second semantic representation of the paraphrasing words in the reference text may be extracted by analogy and will not be described in detail herein.
Step S13: based on the clustering results of the first semantic representation and the second semantic representation, the translation word of the ambiguous word in the target language in the text to be translated is obtained.
Specifically, the first semantic representation and the second semantic representation can be clustered to obtain a plurality of clustering sets, the clustering set where the first semantic representation is located is used as a target set, on the basis, the total number of paraphrasing words corresponding to the second semantic representation in the target set can be further counted, and the paraphrasing word with the maximum total number is used as a translation word. According to the method, through the clustering results of the first semantic representation and the second semantic representation, the translation words of the ambiguous words in the target language are determined in the plurality of translation words, and the accuracy of the translation words is improved.
In one implementation, the first semantic representation and the second semantic representation may be clustered using a clustering algorithm including, but not limited to, K-means. The specific clustering process can refer to the technical details of the clustering algorithm such as K-means and the like, and is not described herein.
In one implementation scenario, still drawing attention with the text to be translated "millet for the next 10 years of planning. "for example, the reference text may include: "Buy me a Xiaomi mobile phone", "I like to eat millet and noodles", "two sets of clusters can be obtained by clustering, one of which contains the text to be translated" the 10-year future planning of millet "is of interest. The first semantic representation of the "medium polysemous word" millet "and the second semantic representation of the paraphrasing word" Xiaomi "in the reference text" Buy me a Xiaomi mobile phone ", the other cluster set comprising the second semantic representations of the paraphrasing word" millet "in the reference text" I like to eat millet and noodles ", so this can count the total number of corresponding paraphrasing words for each of the second semantic representations in the first cluster set: the paraphrasing words "Xiaomi" are 1, and the second semantic representation of other paraphrasing words is not available, so that the paraphrasing words "Xiaomi" can be used as the paraphrasing words of the ambiguous word "millet" in the text to be translated. Other situations can be similar and are not exemplified here.
In one implementation scenario, as described above, candidate texts containing ambiguous words and their paraphrased words may also be retrieved directly from the monolingual database as reference texts, in which case, referring to fig. 2 in combination, the text to be translated is still of interest for "millet for the next 10 years. "for example, the reference text may include: "Buy me a Xiaomi mobile phone", "I like to eat millet and noodles", "millet is the staple food" and "millet is an internet company", two cluster sets can be obtained by clustering, wherein one cluster set contains the text to be translated "the millet is attractive for planning for the next 10 years". The first semantic representation of the ambiguous term "millet" in "the reference text" Buy me a Xiaomi mobile phone ", the second semantic representation of the ambiguous term" Xiaomi "in" the reference text "millet is the second semantic representation of the ambiguous term" millet "in" an internet company ", and the other cluster set comprises the second semantic representation of the ambiguous term" millet "in" the reference text "I like to eat millet and noodles" and the second semantic representation of the ambiguous term "millet" in "the reference text" millet is the main food ", so that the total number of the corresponding ambiguous terms of each second semantic representation in the first cluster set can be counted: the paraphrasing words "Xiaomi" are 1, and the second semantic representation of other paraphrasing words is not available, so that the paraphrasing words "Xiaomi" can be used as the paraphrasing words of the ambiguous word "millet" in the text to be translated. Other situations can be similar and are not exemplified here.
Step S14: and translating the text to be translated based on the translation words to obtain the translation text expressed in the target language.
Specifically, the translation word can be spliced to the text to be translated to obtain an updated text of the text to be translated, and the updated text is translated into the target language to obtain the translated text. According to the method, the translation words are spliced to the text to be translated for translation, so that the translation words of the ambiguous words are expressed in the text to be translated explicitly, direct and accurate prompt can be provided for translation of the ambiguous words in the translation process, and the accuracy of the translation text is improved.
In a specific implementation scenario, in the splicing process, in order to highlight the ambiguous word and the translation word thereof in the text to be translated, preset symbols may be inserted between the ambiguous word and other segmentation words, between the ambiguous word and the translation word, and between the translation word and other words, respectively. Referring to fig. 2 in combination, still drawing attention is planning for the next 10 years with the text "millet" to be translated. For example, the preset symbol may be set to be' # #, and after the translation word "Xiaomi" of the polysomnography "is spliced to the text to be translated by adopting the preset coincidence, the updated text" # # millet# # xiaomi# # is drawn attention in the future 10 years. "note that, the preset symbol may be set as a special symbol that is less common in the text such as @, @, and the like, which is not limited herein. Other text to be translated may be similarly referred to and will not be illustrated herein.
In one specific implementation scenario, as previously described, a translation model may be pre-trained to improve translation efficiency, and on this basis, updated text may be entered into the translation model to obtain translated text in the target language. It should be noted that the translation model may include, but is not limited to: openNMT, tf-seq2seq, etc., without limitation herein. In addition, in order to further improve the accuracy of the translation model, the sample text of the training translation model may include polysemous words and the translation text of the polysemous words expressed in the target language, and the sample text is labeled with the sample translation text. For example, sample text may include, but is not limited to: "# # millet# # xiaomi# # is an internet company" "today # rice flour" # # Mi Fan "# # cheerful" and the like, catering to new product releases "and the like, without limitation. For specific training procedures of the translation model, reference may be made to technical details of the translation model such as OpenNMT, tf-seq2seq, etc., and will not be described herein.
According to the scheme, the text to be translated and a plurality of reference texts are obtained, the text to be translated is represented in a source language, the text to be translated contains ambiguous words, the plurality of reference texts are represented in a target language, each reference text contains the ambiguous words of the ambiguous words, on the basis, the first semantic representation of the ambiguous words in the text to be translated is extracted, the second semantic representation of the ambiguous words in each reference text is extracted, on the basis of the clustering result of the first semantic representation and the second semantic representation, the translation words of the ambiguous words in the target language are obtained, on the basis, the text to be translated is translated based on the translation words, the translation text to be translated is obtained, the translation text expressed in the target language is obtained, therefore, the first semantic representation of the ambiguous words in the text to be translated in the source language is represented by describing the ambiguous words, the second semantic representation of the ambiguous words in the reference text of the target language is clustered on the basis, the first semantic representation and the second semantic representation are accurately judged, on the basis, the translation of the ambiguous words in the target language is translated, on the basis, the translation text to be translated can be translated in the target language is accurately, the translation words can be translated, the translation effect can be greatly improved, and the translation effect can be obviously is obviously interfered.
In some disclosed embodiments, the semantic extraction model is trained by using a plurality of sample texts, and the sample texts contain sample ambiguities, and specific meanings of the sample ambiguities can be referred to the related descriptions of the ambiguities in the foregoing disclosed embodiments, which are not repeated here. Specifically, the sample text can be subjected to word segmentation processing to obtain a plurality of sample word segments, sample word vectors of the sample word segments are respectively obtained, and then the sample word vectors of the sample word segments are input into a semantic extraction model to obtain sample word representations of the sample word segments. It should be noted that, the semantic extraction model may be trained based on the masked word prediction, that is, at least one sample word may be masked (i.e., mask) at each time the semantic extraction model is trained, that is, the plurality of sample words further include at least one masked character (e.g., may be represented as [ mask ]), after the sample word representation of each sample word is extracted, the predicted character corresponding to the masked character may be predicted based on the sample word representation, and the network parameters of the semantic extraction model may be adjusted according to the difference between the actual character corresponding to the masked character and the predicted character corresponding to the masked character. For a specific process of training a model based on masking word prediction, reference may be made to a pre-training process for models such as BERT, which is not described in detail herein.
In one implementation scenario, after the sample text is segmented, whether the left side of the leftmost character of the sample ambiguous word is a space or not can be detected, whether the right side of the rightmost character of the sample ambiguous word is a space or not can be detected, if both the left side character and the right side character of the sample ambiguous word are met, the leftmost character of the sample ambiguous word can be combined with the rightmost character of the sample ambiguous word, and otherwise, the segmented state of the sample ambiguous word is maintained. Referring to table 1, table 1 is a sample text word segmentation schematic. As shown in table 1, the "millet for 10 years into the future" programming for the sample text is of interest. In terms of the word, after the word is segmented, the sample polysomnogen of ' millet ' is divided into ' small ' and ' rice ', the left side of the leftmost character ' small ' is a space, and the right side of the rightmost character ' rice ' is a space, so that the ' small ' and ' rice ' can be combined into ' millet ', and the word can be expressed as ' the attention of ' 10-year future planning of the millet '; similarly, the "millet house" would have been more successful for the sample text. "in terms of the word," millet house "is divided into" small "," rice house "and" home ", and the left side of the leftmost character" small "is a space, and the right side of the rearmost character" rice "is not a space, so" small "and" rice "cannot be combined. Other situations can be similar and are not exemplified here.
Table 1 sample text word segmentation schematic table
Before combination After combination
The future 10 years of millet planning is of great interest. The future 10 years of millet planning is of great interest.
Millet households have achieved greater success Millet households have achieved greater success
In one implementation scenario, the sample text may include a number of sample words, the number of sample text includes a sample original text and a sample enhanced text, and the sample enhanced text is obtained based on the sample original text, wherein the sample enhanced text is obtained by replacing a sample candidate word in the sample original text with a sample target word, and the sample candidate word is a sample word in the sample original text except for a sample polysemous word, the sample target word is the same as the sample candidate word in terms of semantics, and in the case that the sample original text is expressed in a source language, the sample candidate word is expressed in a target language, and in the case that the sample original text is expressed in a target language. Referring to table 2, table 2 is a schematic representation of sample original text and sample enhanced text. As shown in table 2, the "millet for the next 10 years of planning" is of interest for the sample original text. "for 10 years," the sample word "may be selected as a sample candidate word, and then the sample target word is" ten eyes, "and then the corresponding sample enhanced text is" millet future ten eyes planning attractive. "; for the sample original text Millet is kind of food, the sample word can be selected as a sample candidate word, the sample target word is food, and the corresponding sample enhanced text is Millet is kind of food, so that semantic representation of the source language and the target language on the same word or sentence can be more shortened through source language and target language exchange for the non-polysemous word, and the cross-language representation capability of the semantic extraction model can be improved more accurately.
Table 2 sample original text and sample enhanced text schematic form
Sample original text Sample enhanced text
The future 10 years of millet planning is of great interest. The future tenyears program of millet is of interest.
Millet is a kind of food. Millet is kind of food.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating an embodiment of a text translation device 40 according to the present application. The text translation device 40 includes: the text obtaining module 41, the semantic extraction module 42, the semantic clustering module 43 and the language translation module 44, wherein the text obtaining module 41 is used for obtaining a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, a plurality of reference texts are expressed in a target language, and each reference text contains the ambiguous words; the semantic extraction module 42 is configured to extract a first semantic representation of a polysemous word in the text to be translated, and extract a second semantic representation of a paraphrasing word in each reference text; the semantic clustering module 43 is configured to obtain, based on a clustering result of the first semantic representation and the second semantic representation, a translated term in which the ambiguous term is interpreted in a target language in the text to be translated; the language translation module 44 is configured to translate the text to be translated based on the translated terms to obtain translated text expressed in the target language.
According to the scheme, the first semantic representation of the ambiguous word in the text to be translated in the source language representation and the second semantic representation of the ambiguous word in the reference text of the target language representation are described, clustering is carried out based on the first semantic representation and the second semantic representation, so that the method is beneficial to accurately judging the translation word of the ambiguous word in the target language, and translating the text to be translated on the basis, interference of the ambiguous term of the ambiguous word on translation can be eliminated as much as possible, further the translation effect of the ambiguous word can be remarkably improved, and translation accuracy is improved.
In some disclosed embodiments, the ambiguous word contains several sense items and the paraphrasing word in several reference text covers several sense items.
Therefore, the ambiguous word contains a plurality of kinds of meaning items, and the meaning-releasing words in the plurality of reference texts cover the plurality of kinds of meaning items, so that the method can be beneficial to determining the translation words of the ambiguous word which are released in the target language in the text to be translated from the meaning-releasing words corresponding to all the meaning items, and is beneficial to improving the translation effect.
In some disclosed embodiments, the semantic extraction module 42 includes a word segmentation sub-module for obtaining a number of segmented words of the input text; wherein the plurality of word segments comprise target words; the semantic extraction module 42 includes an extraction sub-module, configured to obtain a first term representation of the target term based on semantic information of the target term and its reference term, and obtain a second term representation of the target term based on attention weights of the plurality of segmentation terms to the target term, respectively; wherein the reference word includes a word segment located before and/or after the target word; the semantic extraction module 42 includes a fusion sub-module, configured to fuse the first word representation and the second word representation to obtain a fused semantic representation of the target word; wherein, the target word is a polysemous word when the input text is a text to be translated, the fusion semantic representation is a first semantic representation, and the target word is a paraphrase word when the input text is a reference text, and the fusion semantic representation is a second semantic representation.
Therefore, on one hand, the first word representation of the target word is obtained through semantic information of the target word and semantic information of a reference word thereof, so that word sequence information and grammar structures of input text can be modeled, meanwhile, the reference word is a word segmentation before and/or after the target word, namely, the word segmentation adjacent to the position of the target word is referred, because the word segmentation adjacent to the position has a stronger semantic relation, the accuracy of the first word representation is improved, on the other hand, the second word representation of the target word is obtained through the attention weights of a plurality of word segmentation on the target word respectively, the relation between the target word and other word segmentation at each position can be captured in a large range as possible, the semantic characteristics of the target word are enhanced, the accuracy of the second word representation is improved, and on the basis, the accuracy of the fusion semantic representation can be improved through the fusion of the first word representation and the second word representation respectively extracted from the two aspects.
In some disclosed embodiments, the extraction sub-module is specifically configured to perform weighted processing on word semantic representations of the plurality of segmented words by using the attention weights of the plurality of segmented words to obtain a second word representation; under the condition that the word segmentation is the virtual word, the attention weight of the word segmentation to the target word is lower than a preset threshold value.
Therefore, under the condition that the segmentation word is an imaginary term, the attention weight of the segmentation word to the target word is set to be lower than a preset threshold value, so that the influence of the imaginary term on the semantic meaning of the target word can be reduced as much as possible, and the semantic meaning representation accuracy is improved.
In some disclosed embodiments, the plurality of segmentations further include identification characters for representing languages used for inputting text.
Therefore, the identification characters are arranged in a plurality of word segments and used for representing languages adopted by the input text, so that language characteristics of the input text can be enhanced in the semantic extraction process.
In some disclosed embodiments, the fusion submodule includes a factor determination unit for obtaining a first weighting factor of the first word representation and a second weighting factor of the second word representation based on a degree of correlation between the first word representation and the second word representation; the fusion submodule comprises a weighting processing unit which is used for respectively carrying out weighting processing on the first word representation and the second word representation by using the first weighting factor and the second weighting factor to obtain fusion semantic representation.
Therefore, based on the relativity between the first word representation and the second word representation, a first weighting factor of the first word representation and a second weighting factor of the second word representation are obtained, the first word representation and the second word representation are respectively weighted by the first weighting factor and the second weighting factor, and fusion semantic representation is obtained, so that the word representations obtained from the two dimensions can be referenced to different degrees, and the accuracy of the word representation of the target word can be improved.
In some disclosed embodiments, the first semantic representation and the second semantic representation are both extracted using a semantic extraction model that is trained using a number of sample texts that contain sample ambiguities.
Therefore, the first semantic representation and the second semantic representation are extracted by using the semantic extraction model, the semantic extraction model is obtained by training a plurality of sample texts, and the sample texts contain sample ambiguities, so that the semantic extraction efficiency can be improved.
In some disclosed embodiments, the sample text includes a number of sample words, the number of sample text includes a sample original text and a sample enhanced text, and the sample enhanced text is derived based on the sample original text; the sample enhanced text is obtained by replacing sample candidate word in a sample original text with sample target word, the sample candidate word is a sample word except for a sample polysemous word in the sample original text, the sample target word has the same meaning as the sample candidate word, the sample candidate word is expressed in a target language under the condition that the sample original text is expressed in a source language, and the sample candidate word is expressed in the source language under the condition that the sample original text is expressed in the target language.
Therefore, for non-ambiguous words, semantic representation of the source language and the target language on the same word or sentence can be more shortened through interchange of the source language and the target language, and cross-language representation capability of the semantic extraction model is improved more accurately.
In some disclosed embodiments, the semantic extraction model includes a first semantic extraction network, a second semantic extraction network, and a semantic fusion network, and the semantic fusion network is configured to fuse word representations extracted by the first semantic extraction network and the second semantic extraction network, respectively.
Therefore, the semantic extraction model comprises a first semantic extraction network, a second semantic extraction network and a semantic fusion network, and the semantic fusion network is used for fusing word representations respectively extracted by the first semantic extraction network and the second semantic extraction network, namely, the word representations can be extracted through the cooperation of the first semantic extraction network, the second semantic extraction network and the semantic fusion network, so that the extraction efficiency of the word representations is improved.
In some disclosed embodiments, the semantic clustering module 43 includes a clustering sub-module, configured to cluster the first semantic representation and the second semantic representation to obtain a plurality of cluster sets, and use the cluster set in which the first semantic representation is located as a target set; the semantic clustering module 43 includes a statistics sub-module for counting the total number of paraphrasing words corresponding to the second semantic representation in the target set; the semantic clustering module 43 includes a determination sub-module for regarding the paraphrasing words with the largest total number as translation words.
Therefore, according to the mode, through the clustering result of the first semantic representation and the second semantic representation, the translation words of which the ambiguous words are interpreted in the target language are determined in a plurality of interpretation words, and the accuracy of the translation words is improved.
In some disclosed embodiments, the language translation module 44 includes a concatenation sub-module for concatenating the translated terms to the text to be translated, resulting in an updated text of the text to be translated; the language translation module 44 includes a translation sub-module for translating the updated text into the target language to obtain translated text.
Therefore, the translation words are spliced to the text to be translated for translation, so that the translation words of the ambiguous words are expressed in the text to be translated, direct and accurate prompt can be provided for translation of the ambiguous words in the translation process, and the accuracy of the translation text is improved.
Referring to fig. 5, fig. 5 is a schematic diagram of a frame of an embodiment of an electronic device 50 of the present application. The electronic device 50 comprises a memory 51 and a processor 52 coupled to each other, the memory 51 having stored therein program instructions, the processor 52 being adapted to execute the program instructions to implement the steps of any of the text translation method embodiments described above. In particular, electronic device 50 may include, but is not limited to: desktop computers, notebook computers, servers, cell phones, tablet computers, and the like, are not limited herein.
In particular, the processor 52 is operative to control itself and the memory 51 to implement the steps in any of the text translation method embodiments described above. The processor 52 may also be referred to as a CPU (Central Processing Unit ). The processor 52 may be an integrated circuit chip having signal processing capabilities. Processor 52 may also be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 52 may be commonly implemented by an integrated circuit chip.
According to the scheme, the first semantic representation of the ambiguous word in the text to be translated in the source language representation and the second semantic representation of the ambiguous word in the reference text of the target language representation are described, clustering is carried out based on the first semantic representation and the second semantic representation, so that the method is beneficial to accurately judging the translation word of the ambiguous word in the target language, and translating the text to be translated on the basis, interference of the ambiguous term of the ambiguous word on translation can be eliminated as much as possible, further the translation effect of the ambiguous word can be remarkably improved, and translation accuracy is improved.
Referring to FIG. 6, FIG. 6 is a schematic diagram illustrating an embodiment of a computer readable storage medium 60 of the present application. The computer readable storage medium 60 stores program instructions 61 that can be executed by a processor, the program instructions 61 for implementing the steps in any of the text translation method embodiments described above.
According to the scheme, the first semantic representation of the ambiguous word in the text to be translated in the source language representation and the second semantic representation of the ambiguous word in the reference text of the target language representation are described, clustering is carried out based on the first semantic representation and the second semantic representation, so that the method is beneficial to accurately judging the translation word of the ambiguous word in the target language, and translating the text to be translated on the basis, interference of the ambiguous term of the ambiguous word on translation can be eliminated as much as possible, further the translation effect of the ambiguous word can be remarkably improved, and translation accuracy is improved.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical, or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all or part of the technical solution contributing to the prior art or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.

Claims (13)

1. A method of text translation, comprising:
acquiring a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, the plurality of reference texts are expressed in a target language, and each reference text contains paraphrasing words of the ambiguities;
extracting first semantic representations of the ambiguous words in the text to be translated, and respectively extracting second semantic representations of the paraphrasing words in each reference text;
based on the clustering results of the first semantic representation and the second semantic representation, acquiring translation words of the ambiguous words in the text to be translated, which are interpreted in the target language;
translating the text to be translated based on the translation word to obtain a translation text expressed in the target language;
the extracting the first semantic representation of the ambiguous word in the text to be translated or the extracting the second semantic representation of the paraphrasing word in each reference text respectively comprises the following steps:
acquiring a plurality of word segments of an input text; wherein the plurality of word segments comprise target words;
At least one of the following is performed to obtain at least one word representation: obtaining a first word representation of the target word based on semantic information of the target word and a reference word thereof, and obtaining a second word representation of the target word based on attention weights of the plurality of segmentation words to the target word respectively; the reference word includes a word segment located before and/or after the target word;
taking the first word representation as a fusion semantic representation of the target word when the at least one word representation comprises the first word representation, taking the second word representation as a fusion semantic representation of the target word when the at least one word representation comprises the second word representation, and fusing based on the first word representation and the second word representation when the at least one word representation comprises the first word representation and the second word representation to obtain a fusion semantic representation of the target word;
wherein, the target word is the ambiguous word when the input text is the text to be translated, the fusion semantic representation is the first semantic representation, the target word is the paraphrase word when the input text is the reference text, and the fusion semantic representation is the second semantic representation.
2. The method of claim 1, wherein the polysemous word contains a number of sense items and the paraphrasing word in the number of reference texts overlays the number of sense items.
3. The method of claim 1, wherein the deriving the second term representation of the target term based on the attention weights of the plurality of segmented terms to the target term, respectively, comprises:
respectively weighting the word semantic representations of the plurality of segmented words by using the attention weights of the target words to obtain the second word representation;
and under the condition that the word segmentation is the virtual word, the attention weight of the word segmentation to the target word is lower than a preset threshold value.
4. The method of claim 1, wherein the plurality of words further comprises an identification character, wherein the identification character is used to represent a language used by the input text.
5. The method of claim 1, wherein, in the case where the at least one term representation includes the first term representation and the second term representation, the fusing based on the first term representation and the second term representation results in a fused semantic representation of the target term, comprising:
Obtaining a first weighting factor of the first word representation and a second weighting factor of the second word representation based on a degree of correlation between the first word representation and the second word representation;
and respectively carrying out weighting processing on the first word representation and the second word representation by using the first weighting factor and the second weighting factor to obtain the fusion semantic representation.
6. The method of claim 1, wherein the first semantic representation and the second semantic representation are each extracted using a semantic extraction model trained using a plurality of sample texts containing sample ambiguities.
7. The method of claim 6, wherein the sample text comprises a number of sample segmentations, the number of sample text comprises sample original text and sample enhanced text, and the sample enhanced text is derived based on the sample original text;
the sample enhanced text is obtained by replacing a sample candidate word in the sample original text with a sample target word, the sample candidate word is a sample word except for the sample ambiguous word in the sample original text, the sample target word has the same meaning as the sample candidate word, the sample candidate word is expressed in the target language when the sample original text is expressed in the source language, and the sample candidate word is expressed in the source language when the sample original text is expressed in the target language.
8. The method of claim 6, wherein the semantic extraction model includes a first semantic extraction network, a second semantic extraction network, and a semantic fusion network, and wherein the semantic fusion network is configured to fuse word representations extracted by the first semantic extraction network and the second semantic extraction network, respectively.
9. The method of claim 1, wherein the obtaining, based on the clustering result of the first semantic representation and the second semantic representation, the translated term of the ambiguous term in the text to be translated that is paraphrased in the target language comprises:
clustering the first semantic representation and the second semantic representation to obtain a plurality of clustering sets, and taking the clustering set where the first semantic representation is located as a target set;
counting the total number of paraphrasing words corresponding to the second semantic representation in the target set;
and taking the paraphrase word with the largest total number as the translation word.
10. The method of claim 1, wherein translating the text to be translated based on the translated terms to obtain translated text in the target language comprises:
Splicing the translation words to the text to be translated to obtain an updated text of the text to be translated;
and translating the updated text into the target language to obtain the translated text.
11. A text translation device, comprising:
the text acquisition module is used for acquiring a text to be translated and a plurality of reference texts; the text to be translated is expressed in a source language, the text to be translated contains ambiguities, the plurality of reference texts are expressed in a target language, and each reference text contains paraphrasing words of the ambiguities;
the semantic extraction module is used for extracting first semantic representations of the ambiguous words in the text to be translated and extracting second semantic representations of the paraphrasing words in each reference text respectively;
the semantic clustering module is used for acquiring translation words of the ambiguous words in the text to be translated, which are interpreted in the target language, based on the clustering results of the first semantic representation and the second semantic representation;
the language translation module is used for translating the text to be translated based on the translation words to obtain a translation text expressed by the target language;
The semantic extraction module comprises a word segmentation sub-module, an extraction sub-module and a fusion sub-module, wherein the word segmentation sub-module is used for obtaining a plurality of words of an input text; wherein the plurality of word segments comprise target words; the extraction sub-module is configured to perform at least one of the following to obtain at least one word representation: obtaining a first word representation of the target word based on semantic information of the target word and a reference word thereof, and obtaining a second word representation of the target word based on attention weights of the plurality of segmentation words to the target word respectively; the reference word includes a word segment located before and/or after the target word; the fusion submodule is used for taking the first word representation as a fusion semantic representation of the target word when the at least one word representation comprises the first word representation, taking the second word representation as the fusion semantic representation of the target word when the at least one word representation comprises the second word representation, and fusing based on the first word representation and the second word representation to obtain the fusion semantic representation of the target word when the at least one word representation comprises the first word representation and the second word representation; wherein, the target word is the ambiguous word when the input text is the text to be translated, the fusion semantic representation is the first semantic representation, the target word is the paraphrase word when the input text is the reference text, and the fusion semantic representation is the second semantic representation.
12. An electronic device comprising a memory and a processor coupled to each other, the memory having program instructions stored therein, the processor being configured to execute the program instructions to implement the text translation method of any of claims 1 to 10.
13. A computer readable storage medium, characterized in that program instructions executable by a processor for implementing the text translation method of any one of claims 1 to 10 are stored.
CN202110982411.5A 2021-08-25 2021-08-25 Text translation method and related device, electronic equipment and storage medium Active CN113723116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110982411.5A CN113723116B (en) 2021-08-25 2021-08-25 Text translation method and related device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110982411.5A CN113723116B (en) 2021-08-25 2021-08-25 Text translation method and related device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113723116A CN113723116A (en) 2021-11-30
CN113723116B true CN113723116B (en) 2024-02-13

Family

ID=78677936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110982411.5A Active CN113723116B (en) 2021-08-25 2021-08-25 Text translation method and related device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113723116B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114707489B (en) * 2022-03-29 2023-08-18 马上消费金融股份有限公司 Method and device for acquiring annotation data set, electronic equipment and storage medium
US20230095352A1 (en) * 2022-05-16 2023-03-30 Beijing Baidu Netcom Science Technology Co., Ltd. Translation Method, Apparatus and Storage Medium
CN115310462B (en) * 2022-10-11 2023-03-24 中孚信息股份有限公司 Metadata recognition translation method and system based on NLP technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033307A (en) * 2018-07-17 2018-12-18 华北水利水电大学 Word polyarch vector based on CRP cluster indicates and Word sense disambiguation method
CN110929507A (en) * 2018-08-31 2020-03-27 中国移动通信有限公司研究院 Text information processing method and device and storage medium
CN110991196A (en) * 2019-12-18 2020-04-10 北京百度网讯科技有限公司 Translation method and device for polysemous words, electronic equipment and medium
KR20210049478A (en) * 2019-10-25 2021-05-06 한국전자통신연구원 Apparatus and method for providing user customized translation
KR20210051252A (en) * 2019-10-30 2021-05-10 한국전자통신연구원 Apparatus and method for providing translation for a word with multiple meanings
CN113255345A (en) * 2021-06-10 2021-08-13 腾讯科技(深圳)有限公司 Semantic recognition method, related device and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018110096A1 (en) * 2016-12-13 2018-06-21 パナソニックIpマネジメント株式会社 Translation device and translation method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033307A (en) * 2018-07-17 2018-12-18 华北水利水电大学 Word polyarch vector based on CRP cluster indicates and Word sense disambiguation method
CN110929507A (en) * 2018-08-31 2020-03-27 中国移动通信有限公司研究院 Text information processing method and device and storage medium
KR20210049478A (en) * 2019-10-25 2021-05-06 한국전자통신연구원 Apparatus and method for providing user customized translation
KR20210051252A (en) * 2019-10-30 2021-05-10 한국전자통신연구원 Apparatus and method for providing translation for a word with multiple meanings
CN110991196A (en) * 2019-12-18 2020-04-10 北京百度网讯科技有限公司 Translation method and device for polysemous words, electronic equipment and medium
CN113255345A (en) * 2021-06-10 2021-08-13 腾讯科技(深圳)有限公司 Semantic recognition method, related device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Hybrid Context-Aware Word Sense Disambiguation in Topic Modeling Based Document Representation;Wenbo Li等;《IEEE》;第332-341页 *
一种基于多义词向量表示的词义消歧方法;李国佳等;《智能计算机与应用》;第8卷(第4期);第52-56页 *

Also Published As

Publication number Publication date
CN113723116A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
US11334635B2 (en) Domain specific natural language understanding of customer intent in self-help
CN113723116B (en) Text translation method and related device, electronic equipment and storage medium
Wang et al. Evaluating word embedding models: Methods and experimental results
Mamgain et al. Sentiment analysis of top colleges in India using Twitter data
CN110032639B (en) Method, device and storage medium for matching semantic text data with tag
CN111241237B (en) Intelligent question-answer data processing method and device based on operation and maintenance service
CN109493977A (en) Text data processing method, device, electronic equipment and computer-readable medium
Yin et al. Chinese zero pronoun resolution with deep memory network
CN111159409B (en) Text classification method, device, equipment and medium based on artificial intelligence
CN114580382A (en) Text error correction method and device
Tan et al. phi-LSTM: a phrase-based hierarchical LSTM model for image captioning
Alyami et al. Application of support vector machine for Arabic sentiment classification using twitter-based dataset
Zheng et al. Learning context-specific word/character embeddings
Awais et al. Role of discourse information in Urdu sentiment classification: A rule-based method and machine-learning technique
Shekhar et al. An effective cybernated word embedding system for analysis and language identification in code-mixed social media text
Dubuisson Duplessis et al. Utterance retrieval based on recurrent surface text patterns
CN114398943A (en) Sample enhancement method and device thereof
Hussain et al. A technique for perceiving abusive bangla comments
Hu et al. Emotion prediction oriented method with multiple supervisions for emotion-cause pair extraction
Appidi et al. Creation of corpus and analysis in code-mixed Kannada-English social media data for POS tagging
CN107423293A (en) The method and apparatus of data translation
CN113342932A (en) Method and device for determining target word vector, storage medium and electronic device
Baishya et al. Present state and future scope of Assamese text processing
CN111401070A (en) Word sense similarity determining method and device, electronic equipment and storage medium
Bach et al. Paraphrase identification in Vietnamese documents

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230522

Address after: 230026 No. 96, Jinzhai Road, Hefei, Anhui

Applicant after: University of Science and Technology of China

Applicant after: IFLYTEK Co.,Ltd.

Address before: 230088 666 Wangjiang West Road, Hefei hi tech Development Zone, Anhui

Applicant before: IFLYTEK Co.,Ltd.

GR01 Patent grant
GR01 Patent grant