IP Library Granted Patent US 12,277,402
Granted Patent B2
US 12,277,402 · App. 18/453,427 · Granted Apr 15, 2025

End-to-end neural word alignment process of suggesting formatting in machine translations

Inventors: Thomas Joachim Zenkel (Bamberg, DE); Joern Wuebker (Berlin, DE); John Sturdy DeNero (Berkeley, CA)
Assignee: Lilt, Inc.
G06F40/58G06F40/284G06N3/045
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,277,402
App. No.
18/453,427
Granted
Apr 15, 2025
Kind
B2
Abstract

In an embodiment, the disclosure provides a programmed computer system implemented via client-server Software as a Service (SaaS) techniques that allows for machine translation of digital content. When translating digital content, linguists must translate more than just the text on the page. Formatting, for example, is a commonly used and important aspect of online content that is typically managed with tags, such as <b> for bold and <i> for italics. When linguists work, they must ensure these tags are placed accurately as part of the translation. Projecting tags accurately depends on successfully accomplishing the challenging task of word alignment. Unfortunately, if word alignment is inaccurate, it makes placing formatting tags very difficult. In an embodiment, the present disclosure provides a method of not only translating text, but also efficiently and accurately projecting tags from input text in one language to output text in another language.

Claims (88)

1. A computer-implemented method, comprising:

storing, in computer main memory, an encoding comprising a tokenized vocabulary of a source language and a target language;

training, using the encoding, a forward neural model programmed for translating from the source language to the target language, a forward alignment layer that is programmatically coupled to the forward neural model, a backward neural model for translating from the target language to the source language, and a backward alignment layer that is programmatically coupled to the backward neural model,

storing, in computer main memory, a pairing comprising a source representation of a source sentence associated with the source language and a corresponding target representation of a target sentence associated with the target language;

extracting, based on the source representation and the target representation, forward attention logits from the forward alignment layer and backward attention logits from the backward alignment layer;

programmatically inferring a symmetrized attention matrix that jointly optimizes the likelihood of the pairing under the forward neural model and the backward neural model; and

generating and digitally storing, based on the symmetrized attention matrix, a plurality of first hard alignments between source words comprising source tokens in the source sentence and target words comprising target tokens in the target sentence.

2. The method of claim 1 , at least one of the forward neural model and the backward neural model comprising a Transformer submodel comprising a 6-layer encoder, a 3-layer decoder, 8 attention heads per layer, 256-dimensional hidden states, and 256-dimensional embedding vectors; each alignment layer comprising 256-dimensional hidden states, 256-dimensional embedding vectors, and one attention head; and the Transformer submodel and each alignment layer using a dropout rate of 0.1.

3. The method of claim 1 , further comprising generating the first hard alignments by generating one or more alignment links that programmatically associate one or more source tokens with one or more target tokens, and generating a first hard alignment between each source word and each target word respectively comprising a source token and a target token programmatically associated by an alignment link.

4. The method of claim 3 , further comprising:

projecting, based on the generated first hard alignments, one or more tags from the source sentence to the target sentence, including at least one of underlining, an HTML tag, an XML tag, an SGML tag, a LaTeX tag, italicization, a sentiment annotation, an entity annotation, an intent annotation, a relationship annotation, highlighting, coloring, bolding, superscript, subscript, strikethrough, font, a comment, a footnote, or a link; and

storing, in computer main memory, the target sentence with the projected tags.

5. The method of claim 4 , further comprising projecting the one or more tags based on the generated first hard alignments by executing:

determining, for each opening tag corresponding to a closing tag in the source sentence, a corresponding source tag span;

calculating, for each corresponding source tag span, an alignment score for every possible target tag span; and

projecting, into the target sentence, from each corresponding source tag span to a possible target tag span with the alignment score having the highest value, the opening and closing tags.

6. The method of claim 1 , the first hard alignments being generated by:

transforming the attention logits from the symmetrized attention matrix into forward and backward attention probabilities using a softmax( ) function;

merging the forward and backward attention probabilities into attention scores using a Hadamard product; and

selecting min(n, m) alignments that have the highest values in the merged attention scores, wherein n is a number of source tokens and m is a number of target tokens.

7. The method of claim 1 , further comprising:

programmatically uncoupling the forward alignment layer and the backward alignment layer from the forward neural model and the backward neural model respectively;

programmatically coupling a guided alignment layer comprising an unmasked self-attention sublayer to the forward neural model and the backward neural model;

training, with a plurality of hard alignments that includes the first hard alignments, using the encoding, the guided alignment layer;

storing, in computer main memory, a second pairing comprising a second source representation of a second source sentence associated with the source language and a corresponding second target representation of a second target sentence associated with the target language;

extracting, based on the second source representation and the second target representation, guided attention logits from the guided alignment layer; and

generating, based on the extracted guided attention logits, guided hard alignments between second source words comprising second source tokens in the second source sentence and second target words comprising second target tokens in the second target sentence.

8. The method of claim 7 , each of the forward neural model and the backward neural model comprising a Transformer submodel comprising a 6-layer encoder, a 3-layer decoder, 8 attention heads per layer, 256-dimensional hidden states, and 256-dimensional embedding vectors;

the forward and backward alignment layer each comprising 256-dimensional hidden states, 256-dimensional embedding vectors, and one attention head; and

the Transformer submodel and each of the forward and backward alignment layer using a dropout rate of 0.1.

9. The method of claim 7 , further comprising generating the guided hard alignments by generating one or more alignment links that programmatically associate one or more second source tokens with one or more second target tokens, and

generating a guided hard alignment between each second source word and each second target word respectively comprising a second source token and a second target token programmatically associated by an alignment link.

10. The method of claim 9 , further comprising:

projecting, based on the generated guided hard alignments, one or more tags from the second source sentence to the second target sentence, including at least one of underlining, an HTML tag, an XML tag, an SGML tag, a LaTeX tag, italicization, a sentiment annotation, an entity annotation, an intent annotation, a relationship annotation, highlighting, coloring, bolding, superscript, subscript, strikethrough, font, a comment, a footnote, or a link; and

storing, in computer main memory, the second target sentence with the projected tags.

11. The method of claim 10 , further comprising projecting the one or more tags based on the generated guided hard alignments by executing:

determining, for each opening tag corresponding to a closing tag in the second source sentence, a corresponding source tag span;

calculating, for each corresponding source tag span, an alignment score for every possible target tag span; and

projecting, into the second target sentence, from each corresponding source tag span to a possible target tag span with the alignment score having the highest value, the opening and closing tags.

12. The method of claim 1 , further comprising:

programmatically uncoupling the forward alignment layer and the backward alignment layer from the forward neural model and the backward neural model respectively;

programmatically coupling a guided alignment layer comprising an unmasked self-attention sublayer to the forward neural model;

training, with a plurality of hard alignments that includes the first hard alignments, using the encoding, the guided alignment layer;

storing, in computer main memory, a second pairing comprising a second source representation of a second source sentence associated with the source language and a corresponding second target representation of a second target sentence associated with the target language;

extracting, based on the second source representation and the second target representation, guided attention logits from the guided alignment layer; and

generating, based on the extracted guided attention logits, guided hard alignments between second source words comprising second source tokens in the second source sentence and second target words comprising second target tokens in the second target sentence.

13. The method of claim 12 , each of the forward neural model and the backward neural model comprising a Transformer submodel comprising a 6-layer encoder, a 3-layer decoder, 8 attention heads per layer, 256-dimensional hidden states, and 256-dimensional embedding vectors;

the forward and backward alignment layer each comprising 256-dimensional hidden states, 256-dimensional embedding vectors, and one attention head; and

each Transformer submodel and each of the forward and backward alignment layer using a dropout rate of 0.1.

14. The method of claim 12 , further comprising generating the guided hard alignments by generating one or more alignment links that programmatically associate one or more second source tokens with one or more second target tokens, and

generating a guided hard alignment between each second source word and each second target word respectively comprising a second source token and a second target token programmatically associated by an alignment link.

15. The method of claim 14 , further comprising:

projecting, based on the generated guided hard alignments, one or more tags from the second source sentence to the second target sentence, including at least one of underlining, an HTML tag, an XML tag, an SGML tag, a LaTeX tag, italicization, a sentiment annotation, an entity annotation, an intent annotation, a relationship annotation, highlighting, coloring, bolding, superscript, subscript, strikethrough, font, a comment, a footnote, or a link; and

storing, in computer main memory, the second target sentence with the projected tags.

16. The method of claim 15 , further comprising projecting the one or more tags based on the generated guided hard alignments by executing:

determining, for each opening tag corresponding to a closing tag in the second source sentence, a corresponding source tag span;

calculating, for each corresponding source tag span, an alignment score for every possible target tag span; and

projecting, into the second target sentence, from each corresponding source tag span to a possible target tag span with the alignment score having the highest value, the opening and closing tags.

17. A non-transitory computer-readable storage medium storing one or more instructions which, when executed by one or more processors, cause the one or more processors to perform steps comprising:

storing, in computer main memory, an encoding comprising a tokenized vocabulary of a source language and a target language;

training, using the encoding, a forward neural model programmed for translating from the source language to the target language, a forward alignment layer that is programmatically coupled to the forward neural model, a backward neural model for translating from the target language to the source language, and a backward alignment layer that is programmatically coupled to the backward neural model,

storing, in computer main memory, a pairing comprising a source representation of a source sentence associated with the source language and a corresponding target representation of a target sentence associated with the target language;

extracting, based on the source representation and the target representation, forward attention logits from the forward alignment layer and backward attention logits from the backward alignment layer;

programmatically inferring a symmetrized attention matrix that jointly optimizes the likelihood of the pairing under the forward neural model and the backward neural model; and

generating and digitally storing, based on the symmetrized attention matrix, a plurality of first hard alignments between source words comprising source tokens in the source sentence and target words comprising target tokens in the target sentence.

18. The non-transitory computer-readable storage medium of claim 17 , the steps further comprising:

programmatically uncoupling the forward alignment layer and the backward alignment layer from the forward neural model and the backward neural model respectively;

programmatically coupling a guided alignment layer comprising an unmasked self-attention sublayer to the forward neural model and the backward neural model;

training, with a plurality of hard alignments that includes the first hard alignments, using the encoding, the guided alignment layer;

storing, in computer main memory, a second pairing comprising a second source representation of a second source sentence associated with the source language and a corresponding second target representation of a second target sentence associated with the target language;

extracting, based on the second source representation and the second target representation, guided attention logits from the guided alignment layer; and

generating, based on the extracted guided attention logits, guided hard alignments between second source words comprising second source tokens in the second source sentence and second target words comprising second target tokens in the second target sentence.

19. A computer system, comprising:

one or more processors;

a memory comprising a set of instructions which when executed causes the one or more processors to execute a method, the method comprising:

storing, in computer main memory, an encoding comprising a tokenized vocabulary of a source language and a target language;

training, using the encoding, a forward neural model programmed for translating from the source language to the target language, a forward alignment layer that is programmatically coupled to the forward neural model, a backward neural model programmed for translating from the target language to the source language, and a backward alignment layer that is programmatically coupled to the backward neural model,

storing, in computer main memory, a pairing comprising a source representation of a source sentence associated with the source language and a corresponding target representation of a target sentence associated with the target language;

extracting, based on the source representation and the target representation, forward attention logits from the forward alignment layer and backward attention logits from the backward alignment layer;

programmatically inferring a symmetrized attention matrix that jointly optimizes the likelihood of the pairing under the forward neural model and the backward neural model; and

generating and digitally storing, based on the symmetrized attention matrix, a plurality of first hard alignments between source words comprising source tokens in the source sentence and target words comprising target tokens in the target sentence.

20. The computer system of claim 19 , the method further comprising:

programmatically uncoupling the forward alignment layer and the backward alignment layer from the forward neural model and the backward neural model respectively;

programmatically coupling a guided alignment layer comprising an unmasked self-attention sublayer to the forward neural model and the backward neural model;

training, with a plurality of hard alignments that includes the first hard alignments, using the encoding, the guided alignment layer;

storing, in computer main memory, a second pairing comprising a second source representation of a second source sentence associated with the source language and a corresponding second target representation of a second target sentence associated with the target language;

extracting, based on the second source representation and the second target representation, guided attention logits from the guided alignment layer; and

generating, based on the extracted guided attention logits, guided hard alignments between second source words comprising second source tokens in the second source sentence and second target words comprising second target tokens in the second target sentence.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 22, 2023
From: ZENKEL, THOMAS JOACHIM; WUEBKER, JOERN; DENERO, JOHN STURDY
To: LILT, INC.
Reel/Frame 064662/0103 →
Continuity (2)
Continuation 17245888 · Apr 30, 2021
Related Publication 20230394251A1 · Dec 7, 2023
References Cited (38)
US 11048854B2 · Beaver · 2021 [cited by applicant]
US 11798534B2 · Wang · 2023 [cited by examiner]
US 20200011771A1 · Lee · 2020 [cited by applicant]
US 20200034435A1 · Norouzi · 2020 [cited by examiner]
US 20200184020A1 · Hashimoto · 2020 [cited by examiner]
US 20210279576A1 · Shazeer · 2021 [cited by examiner]
US 20210358491A1 · Prabhavalkar · 2021 [cited by applicant]
US 20220164655A1 · Gomez · 2022 [cited by examiner]
US 20220237391A1 · Zhang · 2022 [cited by examiner]
Tamer Alkhouli et al., On the Alignment Problem in Multi-Head Attention-Based Neural Machine Translation, Proceedings of the Third Conference on Machine Translation (WMT), vol. 1: Research Papers, pp. 177-185. [cited by applicant]
Philip Arthur et al., Incorporating Discrete Translation Lexicons Into Neural Machine Translation, in Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, © 2016 Association for Comput… [cited by applicant]
Dzmitry Bahdanau et al., Neural Machine Translation by Jointly Learning to Align and Translate, International Conference on Learning Representations, arXiv:1409.0473v7 [cs.CL], pp. 1-15. [cited by applicant]
Peter F. Brown et al., The Mathematics of Statistical Machine Translation: Parameter Estimation, Computational linguistics, 19(2), pp. 263-311. [cited by applicant]
John Denero et al., Model-Based Aligner Combination Using Dual Decomposition, Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies—vol. 1, © 2011 Associati… [cited by applicant]
Chris Dyer et al., A Simple, Fast, and Effective Reparameterization of IBM Model 2, Proceedings of the 2013 Conference of the North American Chapter of the © 2013 Association for Computational Linguistics: Human Languag… [cited by applicant]
Carla Parra Escartin et al, 2015. Machine Translation Evaluation Made Fuzzier: A Study on Post-Editing Productivity and Evaluation Metrics in Commercial Settings., Proceedings of MT Summit XV, pp. 131-144. [cited by applicant]
Qin Gao et al, 2008. Parallel Implementations of Word Alignment Tool. Software Engineering, Testing, and Quality Assurance for Natural Language Processing, © 2008 Association for Computational Linguistics, pp. 49-57. [cited by applicant]
Sarthak Garg et al., Jointly Learning to Align and Translate With Transformer Models, Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on … [cited by applicant]
João Graca et al., 2008 Expectation Maximization and Posterior Constraints, Neural Information Processing Systems Conference (NIPS), Vancouver, BC, pp. 1-10. [cited by applicant]
Eric Joanis et al., Transferring Markup Tags in Statistical Machine Translation: A Two-Stream Approach, Proceedings of MT Summit XIV Workshop on Post-Editing Technology Practice, pp. 73-81. [cited by applicant]
Philipp Koehn et al. 2005 Edinburgh System Description for the 2005 IWSLT Speech Translation Evaluation, Proceedings of the Second International Workshop on Spoken Language Translation in International Workshop on Spoke… [cited by applicant]
Xintong Li et al. On the Word Alignment from Neural Machine Translation, Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, © 2019 Association for Computational Linguistics, pp. 129… [cited by applicant]
Percy Liang et al., Alignment by Agreement, Proceedings of the Human Language Technology Conference of the North American Chapter of the Association of Computational Linguistics. Association for Computational Linguistic… [cited by applicant]
I Dan Melamed, Annotation Style Guide for The Blinker Project Version 1.0.4. arXiv:cmp-lg/9805004, pp. 1-20. [cited by applicant]
Rada Mihalcea et al., An Evaluation Exercise for Word Alignment, HLT-NAACL 2003 Workshop on Building and Using Parallel Texts Data Driven Machine Translation and Beyond, pp. 1-10. [cited by applicant]
Mathias Müller, Treatment of Markup in Statistical Machine Translation, Proceedings of the Third Workshop on Discourse in Machine Translation, pp. 36-46. [cited by applicant]
Franz Josef Och et al., A Comparison of Alignment Models for Statistical Machine Translation. In Coling 2000 vol. 2: The 18th International Conference on Computational Linguistics, pp. 1086-1090. [cited by applicant]
Franz Josef Och et al., 2000b. Improved Statistical Alignment Models, in Proceedings of the 38th Annual Meeting on Association for Computational Linguistics. Association for Computational Linguistics, pp. 440-447. [cited by applicant]
Franz Josef Och et al, 2003. A Systematic Comparison of Various Statistical Alignment Models, Computational Linguistics, 29(1):pp. 19-51. [cited by applicant]
Rico Sennrich et al., Neural Machine Translation of Rare Words with Subword Units, in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (vol. 1: Long Papers), pp. 1715-1725. [cited by applicant]
Elias Stengel-Eskin et al., A Discriminative Neural Model for Cross-Lingual Word Alignment., in Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conf… [cited by applicant]
Akihiro Tamura et al., Recurrent Neural Networks for Word Alignment Model, in Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (vol. 1: Long Papers). Association for Computational … [cited by applicant]
Arda Tezcan et al., 2011. SMT-CAT Integration in a Technical Domain. Handling Xml Mark-Up Using Pre and Post-Editing Processing Methods, in Proceedings of the 15th International Conference of the European Association fo… [cited by applicant]
Aashish Vaswani et al., 2017. Attention Is All You Need, in Advances in Neural Information Processing Systems, 11 pages. [cited by applicant]
Stephan Vogel et al., HMM-Based Word Alignment in Statistical Translation, in Coling 1996 vol. 2: The 16th International Conference on Computational Linguistics, pp. 836-841. [cited by applicant]
Thomas Zenkel et al, Adding Interpretable Attention to Neural Translation Models Improves Word Alignment, 2019 arXiv preprint arXiv:1901.11359, 9 pages. [cited by applicant]
Thomas Zenkel et al., End-to-End Neural Word Alignment Outperforms GIZA++, arXiv: 2004.14675v1, 13 pages. [cited by applicant]
Zhang et al, Look Backward and Forward: Self-Knowledge Distillation with Bidirectional Decoder for Neural Machine translation, https://arxiv.org/abs/2203.05248, pp. 1-12, Mar. 11, 2022. [cited by applicant]