Elsevier

Computers & Graphics

Volume 103, April 2022, Pages 45-60
Computers & Graphics

Special Section on Graphics Interface 2021
Visualization-based improvement of neural machine translation

https://doi.org/10.1016/j.cag.2021.12.003Get rights and content

Highlights

  • A visual-interactive approach for analyzing, understanding, and correcting NMT.

  • Visualizations show model-specific information and metrics for translation quality.

  • Our approach supports both LSTM-based NMT models and the Transformer architecture.

  • The quantitative computer-based evaluation reveals reduced post-editing efforts.

Abstract

We introduce a novel visual-interactive approach for analyzing, understanding, and correcting neural machine translation. Our system supports users in automatically translating documents using neural machine translation and identifying and correcting possible erroneous translations. User corrections can then be used to fine-tune the neural machine translation model and automatically improve the whole document. While translation results of neural machine translation can be impressive, there are still many challenges such as over- and under-translation, domain-specific terminology, and handling long sentences, making it necessary for users to verify translation results. Our system aims at supporting users in this task. Our visual analytics approach combines several visualization techniques in an interactive system. A parallel coordinates plot with multiple metrics related to translation quality can be used to find, filter, and select translations that might contain errors. An interactive beam search visualization and graph- or matrix-based visualizations for attention weights can be used for post-editing and understanding machine-generated translations. The machine translation model is updated from user corrections to improve the translation quality of the whole document. We designed our approach for an LSTM-based translation model and extended it to also include the Transformer architecture. We show for representative examples possible mistranslations and how to use our system to deal with them. A user study revealed that many participants favor such a system over manual text-based translation, especially for translating large documents. Furthermore, we performed quantitative computer-based experiments that show that our system can be used to improve translation quality and reduce post-editing efforts for domain-specific documents.

Introduction

Machine learning and especially deep learning are popular and rapidly growing fields in many research areas. The results created with machine learning models are often impressive but sometimes still problematic. Currently, much research is performed to better understand, explain, and interact with these models. In this context, visualization and visual analytics methods are suitable and more and more often used to explore different aspects of these models. Available techniques for visual analytics in deep learning were examined by Hohman et al. [1]. While there is a large amount of work available for explainability in computer vision, less work exists for machine translation.

As it becomes increasingly important to communicate in different languages, and since information should be available for a huge range of people from different countries, many texts have to be translated. Doing this manually takes much effort. Nowadays, online translation systems like Google Translate [2] or DeepL [3] support humans in translating texts. However, the translations generated that way are often not as expected or like someone familiar with both languages might translate them. It may also not express someone’s translation style or use the correct terminology of a specific domain or for some occasion. Often, more background knowledge about the text is required to translate documents appropriately.

With the introduction of deep learning methods, the translation quality of machine translation models has improved considerably in the last years. However, there are still difficulties that need to be addressed. Common problems of neural machine translation (NMT) models are, for instance, over- and under-translation [4] when words are translated repeatedly or not at all. Handling rare words [5], which might be available in specific documents, and long sentences, are also issues. Domain adaption [5] is another challenge. Especially documents from specific domains such as medicine, law, or science require high-quality translations [6]. As many NMT models are trained on general data sets, their translation performance is worse for domain-specific texts.

If high-quality translations for large texts are required, it is insufficient to use machine translation models alone. These models are computationally efficient and able to translate large documents with low time effort, but they may create erroneous or inappropriate translations. Humans are very slow compared to these models, but they can detect and correct mistranslations when familiar with the languages and the domain terminology. In a visual analytics system, both of these capabilities can be combined. Such a system should provide the translations from an NMT model and possibilities for users to visually explore translation results to find mistranslated sentences, correct them, and steer the machine learning model.

We have developed a visual analytics approach to reach the goals outlined above. First, our system performs automatic translation of a whole, possibly large, document and shows the result in the Document View (Fig. 1). Users can then explore and modify the document on different views [7] (Fig. 2) to improve translations and use these corrections to fine-tune the NMT model. We support different NMT architectures and use both an LSTM-based and a Transformer architecture.

So far, visual analytics systems for deep learning were mostly available for computer vision, some text-related areas, focusing on smaller parts of machine translation [8], [9] or intended for domain experts to gain insight into the models or to debug them [10], [11]. This work contributes to visualization research by introducing the application domain of NMT using a user-oriented visual analytics approach. In our system, we employ different visualization techniques adapted for usage with NMT. Our parallel coordinates plot (Fig. 1(B)) supports the visualization of different metrics related to text quality. The interaction techniques in our graph- and matrix-based visualizations for attention (Fig. 2(B) and (C)) and tree-based visualization for beam search (Fig. 2(D)) are specifically designed for text exploration and modification. They have a strong coupling to the underlying model. Furthermore, our system has a fast feedback loop and allows interaction in real-time. We demonstrate our system’s features in a video and provide the source code1 [12] for our system. The trained models [13] we used in our case study and evaluation are also publicly available.

This paper is an extended version of our previous work [14]. We improved our visual analytics approach by adding a second interactive attention-based visualization for sentences in the form of a matrix (Fig. 2(C)) that supports subword units. In this context, we discuss the differences between our attention visualizations and the circumstances in which one variant might be preferable. Additionally, we allow users to specify parameters in the user interface for a better analysis of translation results. This is especially useful for more experienced users who want to explore more details about the Transformer architecture or about the attention weights in both architectures we implemented. We provide more information about our implemented machine translation models and explore a different document in our case study. Finally, we include a quantitative computer-based evaluation, demonstrating both the utility of our metrics for detecting mistranslated sentences, as well as how fine-tuning LSTM-based models on domain-specific documents increases the in-domain translation quality.

Section snippets

Related work

This section first discusses visualization, visual analytics, and interaction approaches for language translation in general and then visual analytics of deep learning for text. Afterward, we provide an overview of work that combines both areas in the context of NMT.

Many visualization techniques and visual analytics systems exist for text; see Kucher and Kerren [15] for an overview. However, there is little work on exploring and modifying translation results. An interactive system to explore

Visual analytics approach

Our visual analytics approach allows the automatic translation, exploration, and correction of documents. Its components can be split into multiple parts. First, a document is automatically translated from one language into another one. Next, mistranslated sentences in the document are identified by users. Then, the users can explore and correct individual sentences. Finally, the model can be fine-tuned and the document retranslated. This workflow is also shown in Fig. 3.

Our approach has a

Case study

As a typical use case, we take the German Wikipedia article for artificial intelligence (Künstliche Intelligenz) [56] as a document for translation into English. For translation, we used a total of 358 sentences and headings from the article. In the following, we show how to use our system to improve the translation quality of the document. Please see our accompanying video for a demonstration with the Transformer model. The examples in the following were created with both an LSTM and

Evaluation

We conducted a preliminary user study during the development of our approach to evaluate our concept, using a prototype with an LSTM translation model. Our visual analytics system was rated positively in terms of effectiveness, ease of understanding and intuitiveness of visualizations, and ease of interaction. The participants mastered the translation process well using our selected visualizations. Especially our choice of parallel coordinate plots to visualize multiple metrics, and the

Discussion and future work

To conclude, we present a visual analytics approach for exploring, understanding, and correcting translations created by NMT. Our approach supports users in translating large domain-specific documents with interactive visualizations in different views, and it allows sentence correction in real-time and model adaption.

Our qualitative user study results showed that our visual analytics system was rated positively regarding effectiveness, interpretability of visualizations, and ease of interaction.

CRediT authorship contribution statement

Tanja Munz: Conceptualization, Methodology, Software, Formal analysis, Writing – original draft, Visualization, Project administration. Dirk Väth: Conceptualization, Methodology, Software, Writing – original draft. Paul Kuznecov: Conceptualization, Methodology, Software, Formal analysis. Ngoc Thang Vu: Conceptualization, Writing – review & editing, Supervision, Funding acquisition. Daniel Weiskopf: Conceptualization, Writing – review & editing, Supervision, Funding acquisition.

Acknowledgments

This work was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy – EXC-2075 – 390740016.

References (66)

  • LiuS. et al.

    Towards better analysis of machine learning models: A visual analytics perspective

    Vis Informa

    (2017)
  • GarciaR. et al.

    A task-and-technique centered survey on visual analytics for deep learning model engineering

    Comput Graph

    (2018)
  • HohmanF.M. et al.

    Visual analytics in deep learning: An interrogative survey for the next frontiers

    IEEE Trans Vis Comput Graphics

    (2018)
  • GoogleF.M.

    Google translate

    (2021)
  • DeepLF.M.

    Deepl translator

    (2021)
  • Tu Z, Liu Y, Shang L, Liu X, Li H. Neural machine translation with reconstruction. In: Thirty-first AAAI conference on...
  • KoehnP. et al.

    Six challenges for neural machine translation

  • ChuC. et al.

    A survey of domain adaptation for neural machine translation

  • Roberts JC. State of the art: Coordinated multiple views in exploratory visualization. In: Fifth international...
  • LeeJ. et al.

    Interactive visualization and manipulation of attention-based neural machine translation

  • RiktersM. et al.

    Visualizing neural machine translation attention and confidence

    Prague Bull Math Linguist

    (2017)
  • StrobeltH. et al.

    LSTMVis: A tool for visual analysis of hidden state dynamics in recurrent neural networks

    IEEE Trans Vis Comput Graphics

    (2018)
  • StrobeltH. et al.

    Seq2Seq-Vis: A visual debugging tool for sequence-to-sequence models

    IEEE Trans Vis Comput Graphics

    (2019)
  • MunzT. et al.

    NMTVis - extended neural machine translation visualization system

    (2021)
  • MunzT. et al.

    NMTVis - trained models for our visual analytics system

    (2021)
  • MunzT. et al.

    Visual-interactive neural machine translation

  • Kucher K, Kerren A. Text visualization techniques: Taxonomy, visual survey, and community insights. In: 2015 IEEE...
  • AlbrechtJ. et al.

    The Chinese room: Visualization and interaction to understand and correct ambiguous machine translation

    Comput Graph Forum

    (2009)
  • Collins C, Carpendale S, Penn G. Visualization of uncertainty in lattices to support decision-making. In: Proceedings...
  • Green S, Chuang J, Heer J, Manning CD. Predictive translation memory: A mixed-initiative system for human language...
  • Green S, Heer J, Manning CD. The efficacy of human post-editing for language translation. In: Proceedings of the SIGCHI...
  • GreenS. et al.

    Natural language translation at the intersection of AI and HCI

    Commun ACM

    (2015)
  • ChooJ. et al.

    Visual analytics for explainable deep learning

    IEEE Comput Graph Appl

    (2018)
  • YuanJ. et al.

    A survey of visual analytics techniques for machine learning

    Comput Vis Media

    (2020)
  • Ming Y, Cao S, Zhang R, Li Z, Chen Y et al. Understanding hidden memories of recurrent neural networks. In: 2017 IEEE...
  • KarpathyA. et al.

    Visualizing and understanding recurrent networks

    (2015)
  • HermannK.M. et al.

    Teaching machines to read and comprehend

  • Cashman D, Patterson G, Mosca A, Chang R. RNNbow: Visualizing learning via backpropagation gradients in recurrent...
  • BahdanauD. et al.

    Neural machine translation by jointly learning to align and translate

    (2014)
  • YangS. et al.

    A survey of deep learning techniques for neural machine translation

    (2020)
  • VaswaniA. et al.

    Attention is all you need

  • VigJ.

    A multiscale visualization of attention in the transformer model

  • VigJ.

    Visualizing attention in transformerbased language models

    (2019)
  • View full text