CN112036195A - Machine translation method, device and storage medium - Google Patents

Machine translation method, device and storage medium Download PDF

Info

Publication number
CN112036195A
CN112036195A CN202010974996.1A CN202010974996A CN112036195A CN 112036195 A CN112036195 A CN 112036195A CN 202010974996 A CN202010974996 A CN 202010974996A CN 112036195 A CN112036195 A CN 112036195A
Authority
CN
China
Prior art keywords
chapter
translation
result
translated
discourse
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.)
Pending
Application number
CN202010974996.1A
Other languages
Chinese (zh)
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.)
Beijing Xiaomi Pinecone Electronic Co Ltd
Original Assignee
Beijing Xiaomi Pinecone Electronic 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 Beijing Xiaomi Pinecone Electronic Co Ltd filed Critical Beijing Xiaomi Pinecone Electronic Co Ltd
Priority to CN202010974996.1A priority Critical patent/CN112036195A/en
Publication of CN112036195A publication Critical patent/CN112036195A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Machine Translation (AREA)

Abstract

The disclosure relates to a machine translation method, a machine translation device and a storage medium. The method can comprise the following steps: acquiring chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter; and inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result. The method and the device can input the chapter structure information and the text information of the chapter to be translated into the translation model to obtain the translation result. Because the chapter structure information can indicate the chapter structure of the chapter to be translated, and the translation model fused with the chapter structure information is used for translating the chapter to be translated, each sentence in the chapter to be translated can be translated, the literary logic of the chapter to be translated can be fused into the translation result, and the accuracy of the translation result can be improved.

Description

Machine translation method, device and storage medium
Technical Field
The present disclosure relates to the field of machine translation, and in particular, to a machine translation method, apparatus, and storage medium.
Background
In the field of machine translation, because of the limitation of machines, a single-sentence translation method is generally adopted to translate the chapters to be translated, that is, each sentence in the chapters to be translated is sequentially modeled and translated. However, because each sentence in the chapter to be translated is modeled in turn, the relevance between the sentences is not considered in the translation process, and the translation result is not accurate enough.
Disclosure of Invention
The disclosure provides a machine translation method, a device and a storage medium.
According to a first aspect of embodiments of the present disclosure, there is provided a machine translation method, including:
acquiring chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result.
Optionally, the obtaining chapter structure information of the chapter to be translated includes:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
Optionally, the inputting the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result includes:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
Optionally, the obtaining the translation result according to the first encoding result and the second encoding result includes:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
Optionally, the obtaining the translation result according to the target encoding result includes:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
Optionally, the method further includes:
training the translation model based on a preset training corpus to obtain a target translation model;
inputting the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result, wherein the method comprises the following steps:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
According to a second aspect of embodiments of the present disclosure, there is provided a machine translation apparatus including:
the acquisition module is configured to acquire chapter structure information of chapters to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and the translation module is configured to input the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result.
Optionally, the obtaining module is further configured to:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
Optionally, the translation module is further configured to:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
Optionally, the translation module is further configured to:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
Optionally, the translation module is further configured to:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
Optionally, the apparatus further comprises:
the training module is configured to train the translation model based on preset training corpora to obtain a target translation model;
the translation module is further configured to:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
According to a third aspect of the embodiments of the present disclosure, there is provided a machine translation apparatus including:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: when executed, implement the steps of any of the above-described machine translation methods.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a machine translation apparatus, enable the apparatus to perform any one of the above-described machine translation methods.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the embodiments, the text information of the chapter to be translated and the chapter structure information can be input into the translation model to obtain the translation result. Because the chapter structure information can indicate the chapter structure of the chapter to be translated, and the chapter to be translated is translated through the translation model fused with the chapter structure information, each sentence in the chapter to be translated can be translated, and the literary logic of the chapter to be translated can be fused into the translation result, so that the specific meaning of the polysemous words and/or sentences under the corresponding context of the whole chapter structure can be obtained, and the accuracy of the translation result can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method of machine translation in accordance with an exemplary embodiment.
Fig. 2 is a schematic diagram of a network system according to an example embodiment.
FIG. 3 is a schematic view of a discourse analysis tree, according to an exemplary embodiment.
Fig. 4 is a schematic configuration diagram of an encoder of a translation model in the related art.
Fig. 5 is a block diagram illustrating an encoder of a translation model according to an example embodiment.
FIG. 6 is a block diagram illustrating a machine translation device, according to an example embodiment.
Fig. 7 is a block diagram illustrating an apparatus for machine translation in accordance with an exemplary embodiment.
FIG. 8 is a block diagram illustrating another apparatus for machine translation in accordance with an illustrative embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the present disclosure provides a machine translation method, and fig. 1 is a schematic flow chart of a machine translation method according to an exemplary embodiment, as shown in fig. 1, the method mainly includes the following steps:
in step 101, obtaining chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
in step 102, the chapter structure information and the text information of the to-be-translated chapter are input into a translation model to obtain a translation result.
The machine translation method related in the embodiments of the present disclosure may be applied to an electronic device, where the electronic device includes a mobile terminal and a fixed terminal, where the mobile terminal includes: mobile phones, tablet computers, notebook computers, and the like; the fixed terminal includes: a personal computer. In other optional embodiments, the machine translation method may also be executed in a network side device, where the network side device includes: servers, processing centers, etc.
In some embodiments, the machine translation methods of the present disclosure may be applied to different scenarios. For example, the method can be applied to a stand-alone scene, such as a translator, and a session input by a user is translated through a speech recognition algorithm and a chapter machine translation algorithm which run on the stand-alone scene. For another example, the method may be applied to a multi-machine scenario, for example, the method may be applied to an online translation system, where a user inputs a chapter to be translated and the like through various types of terminals such as a mobile phone and a notebook computer, and transmits the chapter to be translated and the like to a server through a network, and the server processes and translates the input chapter to be translated and transmits a translation result (translation) to the mobile phone and the notebook computer and the like through the network.
Fig. 2 is a schematic diagram illustrating a network system according to an exemplary embodiment, as shown in fig. 2, the network system including: in the implementation process, a user may input a chapter to be translated through the mobile phone 201 and the notebook computer 202, where the chapter to be translated includes: the paragraphs to be translated, the sentences to be translated, and the like are transmitted to the server 203 through the network 204, and the server 203 processes and translates the inputted chapters to be translated and transmits the translation results (translations) to the mobile phone 201, the notebook computer 202, and the like through the network 204.
The chapter structure information in the embodiment of the disclosure is used for indicating the chapter structure of the to-be-translated chapter, representing the literary logic of the to-be-translated chapter, and in the implementation process, the chapter structure information and the text information of the to-be-translated chapter can be input into the translation model to obtain the translation result.
Here, the translation model may include an encoder and a decoder. In the implementation process, an encoder of the translation model can encode the chapter to be translated to obtain an encoding result, then a decoder of the translation model receives the encoding result input by the encoder, decodes the encoding result, inputs decoded information obtained by decoding into the linear layer and the normalization layer, and finally obtains a corresponding translation result. In other embodiments, the translation model includes at least a transform model.
In the embodiment of the disclosure, the chapter structure information and the text information of the chapter to be translated can be input into the translation model to obtain the translation result. Because the chapter structure information can indicate the chapter structure of the chapter to be translated, and the translation model fused with the chapter structure information is used for translating the chapter to be translated, each sentence in the chapter to be translated can be translated, the literary logic of the chapter to be translated can be fused into the translation result, and the accuracy of the translation result can be improved.
In some embodiments, the obtaining chapter structure information of the chapter to be translated includes:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
Here, the basic chapter unit is the most basic unit in chapters and has relatively independent semantics. In the embodiment of the disclosure, a discourse to be translated may be divided into M consecutive basic discourse units, the M basic discourse units are used as leaf nodes of a discourse analysis tree, a functional statement formed by connecting a plurality of consecutive basic discourse units by a specific relationship is used as an internal node, i.e. a non-leaf node, of the discourse analysis tree, and the nodes are connected by a specific discourse and expression relationship and a nuclear relationship. For example, adjacent related basic chapter units are connected by a specific retrieval relationship (Rheographic relationship), and the main part (Nucleus) and the secondary part (satellite) of the retrieval relationship are marked by a nuclear relationship (Nuclerity).
In some embodiments, a semantic segmentation model may be used to determine segmentation points of the chapters to be translated, and the chapters to be translated are segmented based on the determined segmentation points to obtain M basic chapter units. After the M basic Discourse units are obtained, the M basic Discourse units after being divided can be analyzed based on a Discourse Parser (DP), a Discourse analysis tree is automatically constructed according to a Discourse structure theory, and a reasonable retrieval relationship and a nuclear relationship are distributed among all adjacent tree nodes.
For example, taking The chapters to be translated as "The systematic in this systematic and non-systematic patent data with The structured in this document No. filter a and a summary No. filter a and a moving, after The chapters to be translated are divided, The following results can be obtained: first elementary chapter unit: [ The Treasury also said ] e 1; second basic chapter unit: [ non-cubic tenders with less structured time ]; third basic chapter unit: e2[ if postmarked no later Sun Sunday, Oct.29, ] e 3; and a fourth basic chapter unit: [ and received no later this tomorrow ] e 4.
That is, after the sections to be translated are divided, 4 non-overlapping Elementary section Units (EDUs) can be obtained, which are: e1, e2, e3, e 4. After the basic discourse units are obtained, the discourse resolver can be used for analyzing the segmented basic discourse units to obtain a discourse analysis tree.
FIG. 3 is a schematic diagram illustrating a discourse analysis tree, as shown in FIG. 3, with leaf nodes of the discourse analysis tree being basic discourse units (i.e., e1, e2, e3, e4), in accordance with an exemplary embodiment; the non-leaf nodes are discourse relations among the basic discourse units and represent discourse relations of every two leaf nodes; the edge on the tree has two types, i.e., a primary part (i.e., N) and a secondary part (i.e., S), which represent the importance of the corresponding leaf node in the discourse relation.
In the embodiment of the disclosure, after the discourse analysis tree is obtained, the discourse structure information may be extracted, that is, M discourse paths from the root node to the leaf nodes are extracted from the discourse analysis tree and used as discourse structure information corresponding to the basic discourse unit, and all words in the same basic discourse unit have the same discourse structure information. That is to say, in the embodiment of the present disclosure, the chapter structure information at least includes: a chapter path of each basic chapter unit, wherein the chapter path is used for indicating chapter relations between each basic chapter unit.
Illustratively, the 4 chapter paths obtained from e1, e2, e3, and e4 in fig. 3 are as follows:
e 1: CONDITION) - > N- > ATTRIBUTION (Attribution) - > S
e 2: CONDITION) - > N- > ATTRIBUTION (Attribution) - > N
e 3: CONDITION (conditional) - > S- > TEMPORAL (TEMPORAL relation) - > N
e 4: CONDITION (conditional) - > S- > TEMPORAL (TEMPORAL relation) - > N
In the embodiment of the disclosure, the chapters to be translated can be segmented, the chapter analysis tree is obtained according to the basic chapter units obtained by segmentation, and the chapter structure information is obtained according to the chapter paths in the chapter analysis tree. Therefore, in the process of translation, not only can each sentence in the chapter to be translated, but also the literary logic of the chapter to be translated can be fused into the translation result, and the accuracy of the translation result can be improved.
In some embodiments, the inputting the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result includes:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
In some embodiments, the second type of encoder comprises: a first type of encoder and a fully connected network linked at the output of said first type of encoder. In the second type of encoder, the output end of the first type of encoder is the input end of the second type of encoder; the output end of the full-connection network is the output end of the second type encoder.
Fig. 4 is a schematic structural diagram of an encoder of a translation model in the related art, and as shown in fig. 4, the encoder is composed of two parts, namely a sentence encoder and a context encoder. The sentence encoder is used for encoding the current sentence and the context sentence to obtain the hidden state representation of each word; the context encoder can be divided into two levels, firstly, the sentence level context of each context sentence is obtained, and then the chapter level context is obtained according to the sentence level context; and finally, fusing the chapter level context and the hidden state representation of the current sentence to obtain the final hidden state representation of the current sentence, wherein the final hidden state representation lacks modeling of chapter structure information.
Fig. 5 is a schematic structural diagram illustrating an encoder of a translation model according to an exemplary embodiment, where the encoder of the translation model is composed of two parts, namely a sentence encoder and a context encoder, as shown in fig. 5. The sentence encoder is used for encoding the current sentence and the context sentence to obtain the hidden state representation of each word; the context encoder includes a first type of encoder and a second type of encoder. In some embodiments, the first type of encoder may comprise a Transformer model encoder, and the second type of encoder may be formed by a Transformer model encoder and a fully-connected network.
In the implementation process, the text information may be encoded based on the first-type encoder to obtain a first encoding result, and the chapter structure information may be encoded based on the second-type encoder to obtain a second encoding result. For example, a text vector of text information may be obtained based on the word embedding layer, and then the text vector is encoded based on the first-type encoder (word encoder) to obtain a word hidden state, that is, a first encoding result, or a path vector of chapter structure information may be obtained based on the path embedding layer, and then the path vector is encoded based on the second-type encoder (path encoder) to obtain a path hidden state, and after the word hidden state and the path hidden state are obtained, the word hidden state and the path hidden state may be fused to obtain an updated hidden state, that is, a target encoding result.
In some embodiment, the sentence-level context of each word may be obtained based on the target encoding result, and the chapter-level context of each word in the text information may be obtained according to the sentence-level context. Wherein, the calculation formula of the first encoding result is as follows:
H=transformer_encoder(X) (1);
in formula (1), H denotes a first encoding result, and X ═ X1,x2,...,xN) Representing text information consisting of N words, xiIs an embedded representation of the ith word; h ═ H (H)1,h2,...,hi,...,hN) H in (1)iIs a hidden state representation of the ith word, hNIs a hidden state representation of the nth word.
The calculation formula of the second encoding result is as follows:
Figure BDA0002685451680000081
in the formula (2), the first and second groups,
Figure BDA0002685451680000082
the result of the second encoding is represented,
Figure BDA0002685451680000083
for the overall vector representation of the chapter path corresponding to the ith word,
Figure BDA0002685451680000084
is the overall vector representation of the chapter path corresponding to the nth word, wherein,
Figure BDA0002685451680000085
in the formula (3), the first and second groups,
Figure BDA0002685451680000086
for the global vector representation, P, of the chapter path corresponding to the ith wordi=(pi,1,pi,2,...,pi,iM) A chapter path corresponding to the ith word, the chapter path containing iMA node;
Figure BDA0002685451680000087
is an overall vector representation of the path.
In the embodiment of the present disclosure, after the first encoding result and the second encoding result are obtained, the translation result may be obtained according to the first encoding result and the second encoding result. Compared with the technical scheme in fig. 4, in the technical scheme in the embodiment of the present disclosure, the second-class encoder that specially processes the chapter structure information is configured to encode the chapter structure information, so that the chapter structure information can be incorporated in the encoding process, a chapter structure encoder is introduced into the encoder to encode the chapter structure of each sentence, and the equal-to-chapter structure information and the original text information are fused to obtain the hidden state representation that includes both the original text information and the chapter structure information, and the accuracy of the final translation result can be improved.
In some embodiments, said obtaining the translation result according to the first encoding result and the second encoding result includes:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
In some embodiments, the first encoding result and the second encoding result may be added to obtain the target encoding result.
The calculation formula of the target coding result is as follows:
Figure BDA0002685451680000088
in the formula (4), the first and second groups,
Figure BDA0002685451680000089
representing the target encoding result, H representing the first encoding result,
Figure BDA00026854516800000810
representing the second encoding result. In other embodiments, the first encoding result and the second encoding result may be weighted and then summed.
In some embodiments, the obtaining the translation result according to the target encoding result includes:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
In some embodiments, the sentence-level context is calculated as follows:
Figure BDA0002685451680000091
in the formula (5), st,jWhich represents a context at the sentence level,
Figure BDA0002685451680000092
representing a sentence-level query representation,
Figure BDA0002685451680000093
representing a target encoding result; wherein the content of the first and second substances,
Figure BDA0002685451680000094
in the formula (6), the first and second groups,
Figure BDA0002685451680000095
representing sentence-level query representation, htA hidden state representation representing the t-th word in the text message.
In an implementation, the first type of encoder is capable of picking out content associated with each word of the textual information from all context sentences, wherein each context sentence has a different sentence-level context representation for each word of the textual information.
Implicit State representation h of the t-th word in the text messagetObtaining sentence level query representation of the user through a Feed Forward Neural Network (FFN)
Figure BDA0002685451680000096
Followed by
Figure BDA0002685451680000097
Encoding results to a target over an attention network
Figure BDA0002685451680000098
Selecting to obtain corresponding sentence level context st,j
In some embodiments, the discourse-level context is calculated as follows:
Figure BDA0002685451680000099
in the formula (7), dtRepresenting chapter-level context, S, of each word in the text informationt=(st,1,st,2,...,st,J) Representing all sentence-level contexts in which,
Figure BDA00026854516800000910
in the formula (8), the first and second groups,
Figure BDA00026854516800000911
representing sentence-level query representation, htA hidden state representation representing the t-th word in the text message.
In the implementation process, the second-class encoder can pick out the content related to each word in the text information from all the context sentences to obtain the chapter-level context d of each word in the text informationt
In some embodiments, the calculation formula of the fusion result is as follows:
Figure BDA0002685451680000101
in the formula (9), the reaction mixture,
Figure BDA0002685451680000102
denotes the fusion result, λtRepresents a set weight, htRepresenting a hidden state representation of the t-th word in the text information, dtRepresenting a chapter-level context for each word in the textual information.
λt=σ(Whht+Wdht) (10);
In the formula (10), λtIndicates a set weight, WhRepresenting a first parameter matrix, WdRepresenting a second parameter matrix, htA hidden state representation representing the t-th word in the text message. Here, the sentence-level context, the chapter-level context and the text information may be fused by interpolation to obtain a hidden state representation (a fusion result) of each word of the text information, that is, a final output of the encoder. Therefore, the equal-length chapter structure information and the original text information are fused in the encoding process to obtain the hidden state representation containing the original text information and the chapter structure information, and the accuracy of the final translation result can be improved.
In some embodiments, the method further comprises:
training the translation model based on a preset training corpus to obtain a target translation model;
inputting the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result, wherein the method comprises the following steps:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
Here, the preset training expectation may be preprocessed to obtain chapter structure information of the preset training expectation, and the word sequence of the preset training expectation, the chapter structure information of the preset training expectation, the sentence-level context, and the chapter-level context are input into the translation model to obtain an output result (prediction probability), that is, a probability distribution of each word. In the implementation process, a training loss value of the translation model on a preset training expectation can be obtained based on a set loss function, and model parameters of the translation model are updated according to the training loss value until the model converges to obtain a target translation model. Here, the set loss function includes a negative log-likelihood function, and for example, the translation model may be trained by the negative log-likelihood function that minimizes the prediction probability of the text information, and in the training process, the Adam optimizer may also be used to update the translation model parameters.
In some embodiments, in the process of using the target translation model, since the generated sequences of the respective words and the prediction probabilities of the respective generated sequences are output, in the implementation process, the generated sequence with the largest prediction probability may be found by a search algorithm (beam search) algorithm, and a translation of the text information, which is a translation result of the text information, may be output.
Fig. 6 is a block diagram illustrating a machine translation apparatus according to an exemplary embodiment, and as shown in fig. 6, the machine translation apparatus 600 mainly includes:
the obtaining module 601 is configured to obtain chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
the translation module 602 is configured to input the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result.
In some embodiments, the obtaining module 601 is further configured to:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
In some embodiments, the translation module 602 is further configured to:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
In some embodiments, the translation module 602 is further configured to:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
In some embodiments, the translation module 602 is further configured to:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
In some embodiments, the apparatus 600 further comprises:
the training module is configured to train the translation model based on preset training corpora to obtain a target translation model;
the translation module 602, further configured to:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an apparatus 1200 for machine translation, according to an example embodiment. For example, the apparatus 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, apparatus 1200 may include one or more of the following components: processing component 1202, memory 1204, power component 1206, multimedia component 1208, audio component 1210, input/output (I/O) interface 1212, sensor component 1214, and communications component 1216.
The processing component 1202 generally controls overall operation of the apparatus 1200, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1202 may include one or more processors 1220 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 1202 can include one or more modules that facilitate interaction between the processing component 1202 and other components. For example, the processing component 1202 can include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
The memory 1204 is configured to store various types of data to support operation at the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1204 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A power supply component 1206 provides power to the various components of the device 1200. Power components 1206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for apparatus 1200.
The multimedia components 1208 include a screen that provides an output interface between the device 1200 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1200 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
Audio component 1210 is configured to output and/or input audio signals. For example, audio component 1210 includes a Microphone (MIC) configured to receive external audio signals when apparatus 1200 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1204 or transmitted via the communication component 1216. In some embodiments, audio assembly 1210 further includes a speaker for outputting audio signals.
The I/O interface 1212 provides an interface between the processing component 1202 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1214 includes one or more sensors for providing various aspects of state assessment for the apparatus 1200. For example, the sensor assembly 1214 may detect an open/closed state of the device 1200, the relative positioning of the components, such as a display and keypad of the apparatus 1200, the sensor assembly 1214 may also detect a change in the position of the apparatus 1200 or a component of the apparatus 1200, the presence or absence of user contact with the apparatus 1200, an orientation or acceleration/deceleration of the apparatus 1200, and a change in the temperature of the apparatus 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 1214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communications component 1216 is configured to facilitate communications between the apparatus 1200 and other devices in a wired or wireless manner. The apparatus 1200 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives the broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1216 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as memory 1204 comprising instructions, executable by processor 1220 of apparatus 1200 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a machine translation device, enable the machine translation device to perform a machine translation method, the method comprising:
acquiring chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result.
Fig. 8 is a block diagram illustrating another apparatus 1300 for machine translation according to an example embodiment. For example, the apparatus 1300 may be provided as a server. Referring to fig. 8, apparatus 1300 includes a processing component 1322, which further includes one or more processors, and memory resources, represented by memory 1332, for storing instructions, such as application programs, that may be executed by processing component 1322. The application programs stored in memory 1332 may include one or more modules that each correspond to a set of instructions. Further, processing component 1322 is configured to execute instructions to perform the above-described method of machine translation, the method comprising:
acquiring chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result.
The apparatus 1300 may also include a power component 1326 configured to perform power management for the apparatus 1300, a wired or wireless network interface 1350 configured to connect the apparatus 1300 to a network, and an input-output (I/O) interface 1358. The apparatus 1300 may operate based on an operating system stored in the memory 1332, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A method of machine translation, comprising:
acquiring chapter structure information of a chapter to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result.
2. The method of claim 1, wherein the obtaining chapter structure information of chapters to be translated comprises:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
3. The method of claim 1, wherein the inputting the chapter structure information and the text information of the chapter to be translated into a translation model to obtain a translation result comprises:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
4. The method of claim 3, wherein obtaining the translation result according to the first encoding result and the second encoding result comprises:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
5. The method of claim 4, wherein obtaining the translation result according to the target coding result comprises:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
6. The method according to any one of claims 1 to 5, further comprising:
training the translation model based on a preset training corpus to obtain a target translation model;
inputting the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result, wherein the method comprises the following steps:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
7. A machine translation device, comprising:
the acquisition module is configured to acquire chapter structure information of chapters to be translated; the chapter structure information is used for indicating the chapter structure of the to-be-translated chapter;
and the translation module is configured to input the chapter structure information and the text information of the to-be-translated chapter into a translation model to obtain a translation result.
8. The apparatus of claim 7, wherein the obtaining module is further configured to:
utilizing a semantic segmentation model to segment the chapters to be translated to obtain M basic chapter units; wherein each basic discourse unit comprises N words;
analyzing the M basic discourse units to obtain a discourse analysis tree; the discourse analysis tree is used for representing discourse relations among the basic discourse units;
determining the discourse structure information according to M discourse paths corresponding to the M basic discourse units in the discourse analysis tree; wherein M and N are both positive integers.
9. The apparatus of claim 7, wherein the translation module is further configured to:
inputting the text information into a first type encoder of the translation model to obtain a first encoding result;
inputting the chapter structure information into a second encoder of the translation model, wherein the second encoder is composed of the first encoder and a fully-connected network, and a second encoding result is obtained;
and obtaining the translation result according to the first encoding result and the second encoding result.
10. The apparatus of claim 9, wherein the translation module is further configured to:
performing fusion processing on the first coding result and the second coding result to obtain a target coding result;
and obtaining the translation result according to the target coding result.
11. The apparatus of claim 10, wherein the translation module is further configured to:
obtaining a sentence-level context of each word in the text information according to the target coding result;
obtaining chapter-level context of each word in the text information according to the sentence-level context;
fusing the sentence-level context, the chapter-level context and the text information in an interpolation mode to obtain a fusion result;
and inputting the fusion result into a decoder of the translation model to obtain the translation result.
12. The apparatus of any one of claims 7 to 11, further comprising:
the training module is configured to train the translation model based on preset training corpora to obtain a target translation model;
the translation module is further configured to:
and inputting the chapter structure information and the text information of the chapter to be translated into the target translation model to obtain the translation result.
13. A machine translation device, comprising:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: when executed, implement the steps of any of the machine translation methods of claims 1-6 above.
14. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a machine translation apparatus, enable the apparatus to perform the machine translation method of any of claims 1 to 6.
CN202010974996.1A 2020-09-16 2020-09-16 Machine translation method, device and storage medium Pending CN112036195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010974996.1A CN112036195A (en) 2020-09-16 2020-09-16 Machine translation method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010974996.1A CN112036195A (en) 2020-09-16 2020-09-16 Machine translation method, device and storage medium

Publications (1)

Publication Number Publication Date
CN112036195A true CN112036195A (en) 2020-12-04

Family

ID=73589618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010974996.1A Pending CN112036195A (en) 2020-09-16 2020-09-16 Machine translation method, device and storage medium

Country Status (1)

Country Link
CN (1) CN112036195A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668346A (en) * 2020-12-24 2021-04-16 科大讯飞股份有限公司 Translation method, device, equipment and storage medium
CN114580439A (en) * 2022-02-22 2022-06-03 北京百度网讯科技有限公司 Translation model training method, translation device, translation equipment and storage medium
CN116306698A (en) * 2023-03-07 2023-06-23 苏州大学 Chapter machine translation method and system based on pedigree structure theory

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190155909A1 (en) * 2017-11-23 2019-05-23 Samsung Electronics Co., Ltd. Machine translation method and apparatus
WO2019114695A1 (en) * 2017-12-15 2019-06-20 腾讯科技(深圳)有限公司 Translation model-based training method, translation method, computer device and storage medium
CN109948166A (en) * 2019-03-25 2019-06-28 腾讯科技(深圳)有限公司 Text interpretation method, device, storage medium and computer equipment
CN111160050A (en) * 2019-12-20 2020-05-15 沈阳雅译网络技术有限公司 Chapter-level neural machine translation method based on context memory network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190155909A1 (en) * 2017-11-23 2019-05-23 Samsung Electronics Co., Ltd. Machine translation method and apparatus
WO2019114695A1 (en) * 2017-12-15 2019-06-20 腾讯科技(深圳)有限公司 Translation model-based training method, translation method, computer device and storage medium
CN109948166A (en) * 2019-03-25 2019-06-28 腾讯科技(深圳)有限公司 Text interpretation method, device, storage medium and computer equipment
CN111241855A (en) * 2019-03-25 2020-06-05 腾讯科技(深圳)有限公司 Text translation method, text translation device, storage medium and computer equipment
CN111160050A (en) * 2019-12-20 2020-05-15 沈阳雅译网络技术有限公司 Chapter-level neural machine translation method based on context memory network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JUNXUAN CHEN ET AL: "Modeling Discourse Structure for Document-level Neural Machine Translation", 《COMPUTATION AND LANGUAGE》, 8 June 2020 (2020-06-08), pages 1 - 7 *
刘凯: "基于篇章结构理论的单文档自动文摘研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 January 2019 (2019-01-15), pages 138 - 4996 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668346A (en) * 2020-12-24 2021-04-16 科大讯飞股份有限公司 Translation method, device, equipment and storage medium
WO2022134164A1 (en) * 2020-12-24 2022-06-30 科大讯飞股份有限公司 Translation method, apparatus and device, and storage medium
CN112668346B (en) * 2020-12-24 2024-04-30 中国科学技术大学 Translation method, device, equipment and storage medium
CN114580439A (en) * 2022-02-22 2022-06-03 北京百度网讯科技有限公司 Translation model training method, translation device, translation equipment and storage medium
CN116306698A (en) * 2023-03-07 2023-06-23 苏州大学 Chapter machine translation method and system based on pedigree structure theory

Similar Documents

Publication Publication Date Title
CN107291690B (en) Punctuation adding method and device and punctuation adding device
CN111612070B (en) Image description generation method and device based on scene graph
CN107564526B (en) Processing method, apparatus and machine-readable medium
CN112036195A (en) Machine translation method, device and storage medium
CN110781305A (en) Text classification method and device based on classification model and model training method
CN110069624B (en) Text processing method and device
CN114065778A (en) Chapter-level translation method, translation model training method and device
CN111832316A (en) Semantic recognition method and device, electronic equipment and storage medium
CN108345625B (en) Information mining method and device for information mining
CN111369978B (en) Data processing method and device for data processing
CN111832315B (en) Semantic recognition method, semantic recognition device, electronic equipment and storage medium
CN113673261A (en) Data generation method and device and readable storage medium
CN112183119A (en) Machine translation method, device and storage medium
CN107424612B (en) Processing method, apparatus and machine-readable medium
CN110232181B (en) Comment analysis method and device
CN113239707A (en) Text translation method, text translation device and storage medium
CN111324214B (en) Statement error correction method and device
CN111832297A (en) Part-of-speech tagging method and device and computer-readable storage medium
CN111538998A (en) Text encryption method and device, electronic equipment and computer readable storage medium
CN111079422A (en) Keyword extraction method, device and storage medium
CN114462410A (en) Entity identification method, device, terminal and storage medium
CN113326706A (en) Cross-language retrieval method and device and electronic equipment
CN113971218A (en) Position coding method, position coding device and storage medium
CN112149432A (en) Method and device for translating chapters by machine and storage medium
CN108073566B (en) Word segmentation method and device and word segmentation device

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