SlideShare a Scribd company logo
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Tesi di laurea magistrale
relatore
Ch.mo Prof Carlo Sansone
correlatori
Ing. Gabriele Piantadosi, Ph.D.
Ing. Stefano Marrone
candidato
Giuseppe D’Onofrio
Matr. M63/635
OpenTranslator: an open Machine Translation service based on
Neural Networks
Anno Accademico 2017/18
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Context
Automated language translation
Deep Learning approach for Neural Machine Translation (NMT)
Contribution
Training and evaluation of the state-of-the-art model (Transformer) to
translate from English to Italian
Building an open translation service using the Transformer model,
providing:
Two interfaces (web GUI and REST APIs)
Free access to training data (with regular automated update)
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Machine Translation
Several methods have been used:
Rule-based
Statistic
Example-based
Def: Machine Translation (MT) is the process of
translating texts from one language to another
with a software
Neural
Networks
Machine
Translation
Neural Machine
Translation
Deep learning →
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
NMT architectures
The standard architecture is the
Encoder-Decoder
Convolutional Neural Networks (CNN)
Recurrent Neural Networks (RNN)
with LSTM or GRU units
Two main blocks
Encoder: Input sentence → Internal
vector representation
Decoder: Internal vector
representation → translated sentence
RNN Encoder-Decoder by Sutskever et al. (2014)
CNN ByteNet from Kalchbrenner et al. (2017)
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
The Transformer model
Novelty: Multi-Head Attention to understand the context of sentences
Positional Encoding: takes into account the positions of words
Auto-regressive: previous generated words feed input
No recurrence or convolution
Encoder-Decoder architecture
It is arranged in N identical layers
Words are mapped into vectors through Embedding
Inputs can be words or sub-words
Output words are chosen through beam search
Proposed by Google (2017)
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Multi-Head Attention
For each iteration, Attention indicates how the model should focus on each word
Computed on 8 different heads, which are linear projections in different subspaces
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Training pipeline
A vocabulary of 32k
sub-words has been
generated
Evaluation metrics:
Padded cross-
entropy (loss)
BLEU score
Corpus # Sentences # ENG Words # ITA Words
ParaCrawl 8.3 M 179.1 M 180.2 M
EuroParl v7 2.0 M 59.9 M 58.9 M
NewsComment
ary11
45.9 k 1.3 M 1.0 M
OpenSubtitles 19.1 k 0.2 M 0.1 M
Newstest2009 3.0 k 68 k 67 k
Dataset
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Evaluation metric
To score the quality of translations, BLEU score has been used
BLEU counts the matching n-grams (group of n consecutive words)
between a candidate translation and a reference translation, penalising
translations that are shorter, longer or with different words compared to
reference texts
Word order is not relevant for BLEU score
Example:
Candidate: «The car is on the ground.»
Reference: «The cat is on the mat.»
Matching 1-grams 4/6
Matching 2-grams 2/5
Matching 3-grams 1/4
Matching 4-grams 0/3
log 𝐵𝐿𝐸𝑈 = min(1 −
𝑟
𝑐
, 0) +
𝑛=1
𝑁
𝑤 𝑛 𝑙𝑜𝑔 𝑝 𝑛
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Experimental Setup
Training lasted 240k steps
(~ 3 epochs)
Batch size = 4096
Max sentence length = 150
sub-words
Adam (Adaptive moment
estimation) optimizer
Variable learning rate with
warmup
Residual dropout with
P = 0.2
Label smoothing
GPU Hardware: NVIDIA Tesla K80 (Google Colab) with 2496 CUDA cores and 12GB RAM
Tensor2Tensor: a Tensorflow implementation providing NMT models, tools to generate
vocabulary, to train the model and to export it for the deployment
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Experimental Results
Original Translated
Confidence interval of mean (10 observations of 5k chars) in BLEU score
(confidence level = 95%)
Newstest OpenSubtitles
Our proposal 23.32 ± 2.83 16.54 ± 2.63
Google Translate 26.45 ± 2.36 25.9 ± 2.39
DeepL 27.62 ± 2.40 19.48 ± 3.75
Microsoft Translator 24.53 ± 2.28 26.53 ± 2.58
«American stocks suffered a
bloodbath on Monday and
the major stock indexes
registered their greatest fall
in more than 20 years.»
«Lunedì i titoli americani
hanno subito un bagno di
sangue e i principali indici dei
titoli hanno registrato il calo
maggiore in oltre 20 anni.»
«In the past month, a lot of
courses began at the
University. Students from
Naples and other cities are
coming with their private
vehicles, by train or by bus.»
«Nell'ultimo mese sono iniziati
numerosi corsi all'Università:
studenti di Napoli e di altre
città si recano con i loro veicoli
privati, in treno o in autobus.»
«That makes it hard for guys
in my line... to get what I' d
call "quality health care".»
«Ciò rende difficile per le
pistole nella mia linea...
ottenere quello che chiamo
"assistenza sanitaria di
qualità".»
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Translation service architecture
OpenTranslator has two
interfaces:
Web
Rest API (POST)
Input and output sentences
with feedback are stored on a
MySQL database.
With stored data, the model
can be re-trained to improve
itself
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Web interface
Web interface consists of two main blocks:
Left: the user can write a sentence to translate
Right: the result of the translation is presented
The user can leave a feedback on the quality of translation
Positive feedbacks are used to enrich the training dataset
Training dataset and feedbacks can be freely downloaded
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Conclusions
Results show comparable performances (in some cases)
After a train of 7 days, BLEU score still improves
The context of the training dataset strongly affects the ability to generalize
The novelty of our translation service is to provide free APIs
We also provided the dataset and the user feedbacks for free
Future works
Improve the model to achieve a better translation
Add to the GUI the possibility of improve the result with the user input
Deploy an automatic procedure to retrain with the users’ data
Translate other languages (such as Italian to English)
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
More on RNN
GRU
LSTM
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Complexity analysis
Layer type Complexity
per layer
Seq.
operations
Max. path
length
Self-Attention 𝑂 𝑛2
𝑑 𝑂(1) 𝑂(1)
Recurrent 𝑂 𝑛𝑑2 𝑂(𝑛) 𝑂(𝑛)
Convolutional 𝑂 𝑘𝑛𝑑2 𝑂(1) 𝑂(𝑙𝑜𝑔 𝑘 𝑛 )
Self-Attention
(restricted)
𝑂 𝑟𝑛𝑑 𝑂(1) 𝑂(𝑛/𝑟)
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Positional Encoding
𝑷𝑬 𝒑𝒐𝒔+𝒌 = 𝒖 ∗ 𝑷𝑬 𝒑𝒐𝒔,𝟐𝒊 + 𝒗 ∗ 𝑷𝑬 𝒑𝒐𝒔,𝟐𝒊+𝟏
i is the dimension of sinusoid,
pos is the position of the word
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Embedding
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
Beam search
OpenTranslator: an open machine translation service based on neural
networks
Scuola Politecnica e delle Scienze di Base
Corso di Laurea Magistrale in Ingegneria Informatica
BLEU
𝑝 𝑛 =
𝐶∊ 𝐶𝑎𝑛𝑑𝑖𝑑𝑎𝑡𝑒𝑠 𝑛−𝑔𝑟𝑎𝑚 ∊ 𝐶 𝐶𝑜𝑢𝑛𝑡 𝑐𝑙𝑖𝑝(n− 𝑔𝑟𝑎𝑚)
𝐶′∊ 𝐶𝑎𝑛𝑑𝑖𝑑𝑎𝑡𝑒𝑠 𝑛−𝑔𝑟𝑎𝑚′∊ 𝐶′ 𝐶𝑜𝑢𝑛𝑡(n− 𝑔𝑟𝑎𝑚′)
𝐵𝑃 =
1 𝑖𝑓 𝑐 > 𝑟
1 − 𝑒
1−
𝑟
𝑐 𝑖𝑓 𝑐 ≤ 𝑟
r = reference length, c = candidate length

More Related Content

PPTX
Notes on attention mechanism
PPTX
PDF
Deep learning for NLP and Transformer
PPTX
Attention Mechanism in Language Understanding and its Applications
PPTX
Introduction to Transformer Model
PPTX
Deep Learning for Machine Translation
PDF
Advanced Neural Machine Translation (D4L2 Deep Learning for Speech and Langua...
PDF
Moving to neural machine translation at google - gopro-meetup
Notes on attention mechanism
Deep learning for NLP and Transformer
Attention Mechanism in Language Understanding and its Applications
Introduction to Transformer Model
Deep Learning for Machine Translation
Advanced Neural Machine Translation (D4L2 Deep Learning for Speech and Langua...
Moving to neural machine translation at google - gopro-meetup

What's hot (20)

PDF
[IJET-V2I1P13] Authors:Shilpa More, Gagandeep .S. Dhir , Deepak Daiwadney and...
PDF
Neural Machine Translation (D2L10 Insight@DCU Machine Learning Workshop 2017)
PDF
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIONA...
PPTX
Thomas Wolf "Transfer learning in NLP"
PPTX
Natural Language to Visualization by Neural Machine Translation
PDF
Preliminary study on using vector quantization latent spaces for TTS/VC syste...
PPTX
Evolution of JDK Tools for Multithreaded Programming
PDF
On using monolingual corpora in neural machine translation
PPTX
Trans coder
PDF
A Portable Approach for Bidirectional Integration between a Logic and a Stati...
PDF
The effect of distributed archetypes on complexity theory
PDF
Tutorial on end-to-end text-to-speech synthesis: Part 2 – Tactron and related...
PDF
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
PDF
Machine Translation Introduction
PDF
Resume of Gaurang Rathod, Embedded Software Developer
PPTX
2017:12:06 acl読み会"Learning attention for historical text normalization by lea...
PDF
エンドツーエンド音声合成に向けたNIIにおけるソフトウェア群 ~ TacotronとWaveNetのチュートリアル (Part 2)~
PPTX
Deep Learning勉強会@小町研 "Learning Character-level Representations for Part-of-Sp...
PDF
Ab4102211213
PDF
A novel approach based on topic
[IJET-V2I1P13] Authors:Shilpa More, Gagandeep .S. Dhir , Deepak Daiwadney and...
Neural Machine Translation (D2L10 Insight@DCU Machine Learning Workshop 2017)
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIONA...
Thomas Wolf "Transfer learning in NLP"
Natural Language to Visualization by Neural Machine Translation
Preliminary study on using vector quantization latent spaces for TTS/VC syste...
Evolution of JDK Tools for Multithreaded Programming
On using monolingual corpora in neural machine translation
Trans coder
A Portable Approach for Bidirectional Integration between a Logic and a Stati...
The effect of distributed archetypes on complexity theory
Tutorial on end-to-end text-to-speech synthesis: Part 2 – Tactron and related...
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Machine Translation Introduction
Resume of Gaurang Rathod, Embedded Software Developer
2017:12:06 acl読み会"Learning attention for historical text normalization by lea...
エンドツーエンド音声合成に向けたNIIにおけるソフトウェア群 ~ TacotronとWaveNetのチュートリアル (Part 2)~
Deep Learning勉強会@小町研 "Learning Character-level Representations for Part-of-Sp...
Ab4102211213
A novel approach based on topic
Ad

Similar to Master Thesis of Computer Engineering: OpenTranslator (20)

PDF
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
PDF
MULTILINGUAL SPEECH TO TEXT CONVERSION USING HUGGING FACE FOR DEAF PEOPLE
PDF
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIONA...
PDF
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIO...
PDF
IRJET- On-Screen Translator using NLP and Text Detection
DOCX
A project on advanced C language
PPTX
team10.ppt.pptx
PDF
Generative AI Using HPC in Text Summarization and Energy Plants
PPTX
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
PDF
Senjuti Kundu - Resume
PDF
An Optimized Parallel Algorithm for Longest Common Subsequence Using Openmp –...
PPTX
BERT QnA System for Airplane Flight Manual
PDF
Benchmarking open source deep learning frameworks
DOCX
Rajesh - CV
PDF
A NEURAL MACHINE LANGUAGE TRANSLATION SYSTEM FROM GERMAN TO ENGLISH
PDF
Kshama_Parakh
PPTX
Natural Language Processing - Research and Application Trends
PDF
Ai meetup Neural machine translation updated
PDF
IRJET - Pseudocode to Python Translation using Machine Learning
PDF
IRJET- Factoid Question and Answering System
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
MULTILINGUAL SPEECH TO TEXT CONVERSION USING HUGGING FACE FOR DEAF PEOPLE
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIONA...
ANALYZING ARCHITECTURES FOR NEURAL MACHINE TRANSLATION USING LOW COMPUTATIO...
IRJET- On-Screen Translator using NLP and Text Detection
A project on advanced C language
team10.ppt.pptx
Generative AI Using HPC in Text Summarization and Energy Plants
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
Senjuti Kundu - Resume
An Optimized Parallel Algorithm for Longest Common Subsequence Using Openmp –...
BERT QnA System for Airplane Flight Manual
Benchmarking open source deep learning frameworks
Rajesh - CV
A NEURAL MACHINE LANGUAGE TRANSLATION SYSTEM FROM GERMAN TO ENGLISH
Kshama_Parakh
Natural Language Processing - Research and Application Trends
Ai meetup Neural machine translation updated
IRJET - Pseudocode to Python Translation using Machine Learning
IRJET- Factoid Question and Answering System
Ad

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
assetexplorer- product-overview - presentation
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
PPTX
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms II-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Digital Systems & Binary Numbers (comprehensive )
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2
Wondershare Filmora 15 Crack With Activation Key [2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
top salesforce developer skills in 2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Transform Your Business with a Software ERP System
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
assetexplorer- product-overview - presentation
Computer Software and OS of computer science of grade 11.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Design an Analysis of Algorithms I-SECS-1021-03
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx
ai tools demonstartion for schools and inter college

Master Thesis of Computer Engineering: OpenTranslator

  • 1. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Tesi di laurea magistrale relatore Ch.mo Prof Carlo Sansone correlatori Ing. Gabriele Piantadosi, Ph.D. Ing. Stefano Marrone candidato Giuseppe D’Onofrio Matr. M63/635 OpenTranslator: an open Machine Translation service based on Neural Networks Anno Accademico 2017/18
  • 2. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Context Automated language translation Deep Learning approach for Neural Machine Translation (NMT) Contribution Training and evaluation of the state-of-the-art model (Transformer) to translate from English to Italian Building an open translation service using the Transformer model, providing: Two interfaces (web GUI and REST APIs) Free access to training data (with regular automated update)
  • 3. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Machine Translation Several methods have been used: Rule-based Statistic Example-based Def: Machine Translation (MT) is the process of translating texts from one language to another with a software Neural Networks Machine Translation Neural Machine Translation Deep learning →
  • 4. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica NMT architectures The standard architecture is the Encoder-Decoder Convolutional Neural Networks (CNN) Recurrent Neural Networks (RNN) with LSTM or GRU units Two main blocks Encoder: Input sentence → Internal vector representation Decoder: Internal vector representation → translated sentence RNN Encoder-Decoder by Sutskever et al. (2014) CNN ByteNet from Kalchbrenner et al. (2017)
  • 5. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica The Transformer model Novelty: Multi-Head Attention to understand the context of sentences Positional Encoding: takes into account the positions of words Auto-regressive: previous generated words feed input No recurrence or convolution Encoder-Decoder architecture It is arranged in N identical layers Words are mapped into vectors through Embedding Inputs can be words or sub-words Output words are chosen through beam search Proposed by Google (2017)
  • 6. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Multi-Head Attention For each iteration, Attention indicates how the model should focus on each word Computed on 8 different heads, which are linear projections in different subspaces
  • 7. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Training pipeline A vocabulary of 32k sub-words has been generated Evaluation metrics: Padded cross- entropy (loss) BLEU score Corpus # Sentences # ENG Words # ITA Words ParaCrawl 8.3 M 179.1 M 180.2 M EuroParl v7 2.0 M 59.9 M 58.9 M NewsComment ary11 45.9 k 1.3 M 1.0 M OpenSubtitles 19.1 k 0.2 M 0.1 M Newstest2009 3.0 k 68 k 67 k Dataset
  • 8. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Evaluation metric To score the quality of translations, BLEU score has been used BLEU counts the matching n-grams (group of n consecutive words) between a candidate translation and a reference translation, penalising translations that are shorter, longer or with different words compared to reference texts Word order is not relevant for BLEU score Example: Candidate: «The car is on the ground.» Reference: «The cat is on the mat.» Matching 1-grams 4/6 Matching 2-grams 2/5 Matching 3-grams 1/4 Matching 4-grams 0/3 log 𝐵𝐿𝐸𝑈 = min(1 − 𝑟 𝑐 , 0) + 𝑛=1 𝑁 𝑤 𝑛 𝑙𝑜𝑔 𝑝 𝑛
  • 9. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Experimental Setup Training lasted 240k steps (~ 3 epochs) Batch size = 4096 Max sentence length = 150 sub-words Adam (Adaptive moment estimation) optimizer Variable learning rate with warmup Residual dropout with P = 0.2 Label smoothing GPU Hardware: NVIDIA Tesla K80 (Google Colab) with 2496 CUDA cores and 12GB RAM Tensor2Tensor: a Tensorflow implementation providing NMT models, tools to generate vocabulary, to train the model and to export it for the deployment
  • 10. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Experimental Results Original Translated Confidence interval of mean (10 observations of 5k chars) in BLEU score (confidence level = 95%) Newstest OpenSubtitles Our proposal 23.32 ± 2.83 16.54 ± 2.63 Google Translate 26.45 ± 2.36 25.9 ± 2.39 DeepL 27.62 ± 2.40 19.48 ± 3.75 Microsoft Translator 24.53 ± 2.28 26.53 ± 2.58 «American stocks suffered a bloodbath on Monday and the major stock indexes registered their greatest fall in more than 20 years.» «Lunedì i titoli americani hanno subito un bagno di sangue e i principali indici dei titoli hanno registrato il calo maggiore in oltre 20 anni.» «In the past month, a lot of courses began at the University. Students from Naples and other cities are coming with their private vehicles, by train or by bus.» «Nell'ultimo mese sono iniziati numerosi corsi all'Università: studenti di Napoli e di altre città si recano con i loro veicoli privati, in treno o in autobus.» «That makes it hard for guys in my line... to get what I' d call "quality health care".» «Ciò rende difficile per le pistole nella mia linea... ottenere quello che chiamo "assistenza sanitaria di qualità".»
  • 11. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Translation service architecture OpenTranslator has two interfaces: Web Rest API (POST) Input and output sentences with feedback are stored on a MySQL database. With stored data, the model can be re-trained to improve itself
  • 12. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Web interface Web interface consists of two main blocks: Left: the user can write a sentence to translate Right: the result of the translation is presented The user can leave a feedback on the quality of translation Positive feedbacks are used to enrich the training dataset Training dataset and feedbacks can be freely downloaded
  • 13. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Conclusions Results show comparable performances (in some cases) After a train of 7 days, BLEU score still improves The context of the training dataset strongly affects the ability to generalize The novelty of our translation service is to provide free APIs We also provided the dataset and the user feedbacks for free Future works Improve the model to achieve a better translation Add to the GUI the possibility of improve the result with the user input Deploy an automatic procedure to retrain with the users’ data Translate other languages (such as Italian to English)
  • 14. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica More on RNN GRU LSTM
  • 15. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Complexity analysis Layer type Complexity per layer Seq. operations Max. path length Self-Attention 𝑂 𝑛2 𝑑 𝑂(1) 𝑂(1) Recurrent 𝑂 𝑛𝑑2 𝑂(𝑛) 𝑂(𝑛) Convolutional 𝑂 𝑘𝑛𝑑2 𝑂(1) 𝑂(𝑙𝑜𝑔 𝑘 𝑛 ) Self-Attention (restricted) 𝑂 𝑟𝑛𝑑 𝑂(1) 𝑂(𝑛/𝑟)
  • 16. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Positional Encoding 𝑷𝑬 𝒑𝒐𝒔+𝒌 = 𝒖 ∗ 𝑷𝑬 𝒑𝒐𝒔,𝟐𝒊 + 𝒗 ∗ 𝑷𝑬 𝒑𝒐𝒔,𝟐𝒊+𝟏 i is the dimension of sinusoid, pos is the position of the word
  • 17. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Embedding
  • 18. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica Beam search
  • 19. OpenTranslator: an open machine translation service based on neural networks Scuola Politecnica e delle Scienze di Base Corso di Laurea Magistrale in Ingegneria Informatica BLEU 𝑝 𝑛 = 𝐶∊ 𝐶𝑎𝑛𝑑𝑖𝑑𝑎𝑡𝑒𝑠 𝑛−𝑔𝑟𝑎𝑚 ∊ 𝐶 𝐶𝑜𝑢𝑛𝑡 𝑐𝑙𝑖𝑝(n− 𝑔𝑟𝑎𝑚) 𝐶′∊ 𝐶𝑎𝑛𝑑𝑖𝑑𝑎𝑡𝑒𝑠 𝑛−𝑔𝑟𝑎𝑚′∊ 𝐶′ 𝐶𝑜𝑢𝑛𝑡(n− 𝑔𝑟𝑎𝑚′) 𝐵𝑃 = 1 𝑖𝑓 𝑐 > 𝑟 1 − 𝑒 1− 𝑟 𝑐 𝑖𝑓 𝑐 ≤ 𝑟 r = reference length, c = candidate length