0% found this document useful (0 votes)
13 views

Translator

The document outlines a project aimed at developing an AI-powered multilingual translator that addresses communication barriers among people from different cultures and languages. It includes sections on motivation, problem statement, objectives, proposed system architecture, implementation details, and technology stack, focusing on machine learning techniques for translation. The project emphasizes the importance of effective communication in a globalized world and the role of translation in facilitating knowledge exchange.

Uploaded by

meenaloshini68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Translator

The document outlines a project aimed at developing an AI-powered multilingual translator that addresses communication barriers among people from different cultures and languages. It includes sections on motivation, problem statement, objectives, proposed system architecture, implementation details, and technology stack, focusing on machine learning techniques for translation. The project emphasizes the importance of effective communication in a globalized world and the role of translation in facilitating knowledge exchange.

Uploaded by

meenaloshini68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 60

TABLE OF CONTENT

CHAPTER TITLE PAGE NO

ABSTRACT

LIST OF FIGURES

LIST OF TABLES

LIST OF ABBREVATION

I INTRODUCTION

1.1 Motivation

1.2 Problem Statement

1.3 Objectives

1.4 Scope

1.5 Technology Stack


II REVIEW OF LITERATURE

III PROPOSED SYSTEM

3.1 Proposed System

3.1.1 Block Diagram

3.2 Implementation

3.2.1 Algorithm / Flowchart

3.2.2 Dataset

3.2.3 Pseudo code

IV RESULT ANALYSIS

V CONCLUSION

VI FUTURE SCOPE / REFERENCE


ABSTRACT

The development of technology connects everyone from all around the worlds. The
problem is, people cannot really mingle with one another because they have communication
problems. Some of the problems are with other traveler, disabled peoples, Friends in social
media, and International business partners. This device invented to solve this entire problem
that faced by people in today’s life. This device invented to make people more
knowledgeable, reduce miscommunication among people all around the world, connects
people, get maximum profit and give job opportunity to people.

Translation is a medium to transfer the knowledge or information. It can be a bridge


which connects the people from the different languages and cultures. By using translation,
people can learn and understand each other’s languages and cultures.Translation is not
merely at changing words, but also transferring of cultural equivalence with the culture of the
original language and the recipient of that language as well as possible.

The better translation must be accepted by all people in logic and based on fact; thus,
the message which contained in the source language (SL) can satisfy the target language (TL)
reader with the information within. Translation is necessary for the spreading new
information, knowledge, and ideas across the world. It is absolutely necessary to achieve
effective communication between different cultures. In the process of spreading new
information, translation is something that can change history

In today's globalized world, effective communication across different languages is


crucial. This project aims to develop an AI-powered multilingual translator that can process
both text and voice inputs and provide real-time translations in the user’s preferred language.
The system will leverage advanced machine learning techniques, including speech
recognition, neural machine translation, and text-to-speech synthesis, to ensure accurate and
seamless translations.
LIST OF FIGURES
LIST OF ABBREVATION

ABBREVATION DESCRIPTION

SL Source Language

TL Target Language

ST Source Text

TT Target Text

SLV Single Language Vendor

MLV Multi Language Vendor

MT Machine Translation

CAT Computer Assisted Translation

TMS Translation Management System

SLI Signed Language Interpreting

LSP Language Service Provider


CHAPTER 1

INTRODUCTION

Translation is necessary for the spreading new information, knowledge, and ideas
across the world. It is absolutely necessary to achieve effective communication between
different cultures.In the process of spreading new information, translation is something
that can change history.

1.1 MOTIVATION

The Language translators allow computer programmers to write sets of


instructions in specific programming languages. These instructions are converted by the
language translator into machine code. The computer system then reads these machine
code instructions and executes them.

1.2 PROBLEM STATEMENT

The structure of sentences in English and other languages may be different. This is
considered to be one of the main structural problems in translation. Limit your Expertise:
Gain expertise only in a couple of languages that you are already well-versed with. The
translator has to know the exact structure in each language, and use the appropriate
structure.

OBJECTIVES

To extract effective communication between people around the world. To provide


ability for two parties to communicate and exchange the ideas. To encourage learners to
discuss the meaning and use of language at the deepest possible levels. To get a
challenging position in reputed organization.

1.3 SCOPE

Translation is necessary for the spreading of new information, knowledge, and


ideas across the world. It is absolutely necessary to achieve effective communication
between different cultures. It is the only medium by which certain people can know
different works that will expand their knowledge of the world

.
CHAPTER 2

REVIEW OF LITERATURE

S.No Title Author Publication Approach

to develop a proof
concept to provi
1. Direct Speech to Speech Sireesh Haang December 2020 evidence supporting
Translation Using Machine Limbu unique translation syste
Learning that might prove to
better and faster

the key difference in th


approach compared
2. Machine Translation Enhanced Marcello October 2020 the general machi
Computer Assisted Translation Federico translation techniqu
available today is t
lack of an underlying te
representation st
during inference.

The main translati


model along wi
specific areas of futu
3. Auto-Translation for Localized Chris Piech, September 2019 work that has be
Instruction Sami Abu-El- mentioned in this repo
Haija can be used for studies
language translati
using utterances.

to combine all differe


tasks such as spee
Sagar Patil, recognition, te
4. Multilingual Speech and Text Mayuri Phonde, April 2020 translation, text synthes
Recognition and Translation Siddharth and text extraction fro
using Image Prajapati image all embedded
one so that we get a us
friendly application.
Chapter 3

PROPOSED SYSTEM

3.1 PROPOSED SYSTEM


 The aim of the proposed system is to develop a system that has capability to perform
Translation, Converting text to speech, Speech Recognition. The system proposed
here will be developed for a small domain of English words.
 A translator is a programming language processor that modifies a computer program
from one language to another.

3.1.1 BLOCK DIAGRAM


3.2 IMPLEMENTATION

1. IMPORTMODULES:

WeimportttkmodulesfromtkinterlibraryandTranslator,LANGUAGESmodulesf
rom googletrans library, speech recoginition module, gtts module.

2. CREATEADISPLAYWINDOW:

 Weusetkinterlibrarytocreateawindowwherewe’llenterthetextwhichwewantto convert
into voice.
 Tk()initializedtkinterwhichmeanswindowcreated geometry() set the width and height
of the window.
 resizable(0,0)setthefixedsizeofthewindowbg=‘’useto set the background color title()
used to set the title of the window.
 Label()widgetusetodisplayoneormorethanonelineoftextthatusersaren’tableto modify.
 root is the name which we refer to our window text
whichwedisplayonthelabelfontinwhichthetextis written pack organized widget in
block.

3. CREATEAINPUT-OUTPUTTEXTWIDGET:

 Theabovecodecreatestwotextwidgetsoneforenteringtextandtheotherfordisplaying
translated text.
 Text()widgetisusedformultipletextlines.
 wrap=WORDwillstop thelineafterthelastwordthatwillfit.padxputsan extra bit of space
to the left and right of the widget.
 Padyaddsanextrabit ofspacetothetopandbottom.
4. DEFINECOMBOBOX:

 toselectthelanguageuserscanpickaseperatelanguageforboth input data and to translate


their data.
 languagegetsallthevaluesfromthe‘LANGUAGES’dictionaryintheformofalist.
 ttk.Combobox()widgetisaclassofttkmodules.Itisadrop-downlist,whichcanholdmulti-
value and show one item at a time.
 Comboboxisusefultoselectoneoption frommanyoption.

5. DEFINEFUNCTION:

 The Translate function will translate the message and give the output. src gets the
languageselectedasinputtextlanguagedestgetsthelanguageselecttotranslatetext
getstheinputtextenteredbytheuser.”1.0″meansthattheinputshouldbereadfrom zero
characters to line one The END part means to read the text until the end is
reachedtranslator=
Translator()usedtocreateaTranslatorclassobjectOutput_text.delete(1.0,END) delete all
the text from line one to end.
 Output_text.insert(END,translated.text)willinsertthetranslatedtextinOutput_text.

6. CREATEATRANSLATEBUTTON:

 WhenweclickontheTranslatebuttonitwillcallthetranslatefunctionButton()widget used
to display button on our window command is called when we click the button
activebackground sets the background color to use when the button is active
root.mainloop().
3.1.1 ALGORITHM / FLOWCHART:

ALGORITHM:

Step1:Selectthelanguage.

Step2:Inputthetext/speechthatwanttotranslate.

Step 3: Convert the speech into text.

Step4:Languagedetection

Step5:Translateintogivenlanguage

Step 6: Convert speech into text

Step7:Outputoftranslatedlanguage

DATA FLOW DIAGRAM:

USE TRANSLATOR USE


R R

SOURCE LANGUAGE TARGET LANGUAGE


FLOW CHART:
3.2.2 DATASET:

 TkintermoduleasGUIinterface.
 Cttypeslibrary.
 PILlibrary(pythonimaginglibrary).
 Tkinter.Messagebox as MessageBox.
 Speechrecognitionlibrary.
 pyttsx3isatext-to-speechconversionlibrary.
 Threadinglibrary.
 Fromdeep translator moduleimportgoogletranslibrary.
 Gttsmodulefortextto audio.
 PydubisaPythonlibraryworkwithaudiofiles.
CHAPTER 4

SOFTWARE SPECIFICATION

4.1 TECHNOLOGY STACK:

 Programming Language:

Python

 Frontend:

HTML, CSS/Reactjs

 Backend:

FastAPI / Flask (for handling requests and processing translations)

 Database:

SQLite / PostgreSQL (to store user preferences and translation history)

 Machine Learning Models:

1. Speech Recognition (STT): OpenAI Whisper / DeepSpeech / Vosk

2. Translation: MarianMT / mBART / Google Translate API

3. Text-to-Speech (TTS): Tacotron2 / Coqui TTS / gTTS

 Libraries & Frameworks:

1.SpeechRecognition, pydub (for processing voice input)

2.Transformers (for NLP-based translation)

3.TensorFlow / PyTorch (for deep learning models)

 Cloud Services:

Google Cloud / AWS (for deploying models)


CHAPTER 5

METHODOLOGY

5.1 Word Embeddings:


The concept of a word embedding refers to a representation of text that uses words
with similar meanings to represent them similarly. The techniques involved in word
embeddings are, in a predefined vector space, the words are represented as a real-valued
vectors, where each individual word is plotted to one vector, and the values of that vector be
similar to a neural network (Brownlee, 2017). The key here is to use the dense distributed
representation for each individual word, which represents a real-valued vector that might
have tens or hundreds of dimensions. Whereas for sparse word representations, one-hot
encoding is used, in which it requires thousands or millions of dimensions (Brownlee, 2017).

5.2 Word Embedding Algorithms:


The learning process is either supervised, using document statistics, or unsupervised,
employing a neural network model for some purpose, such as document categorization
(Brownlee, 2017).

This section discusses There are three methods for learning a word embedding from
text data. However, this section discusses, about Embedding Layer and Word2Vec.

5.2.1 Embedding Layer:


This Embedding layer works with specific NLP task like document classification or in
language modelling. To do this, the corpus have to be prepared by cleaning it, such that each
word in the corpus have to be one-hot encoded. Initially, these vectors are assigned with
small random values. This embedding layer fits in a supervised way on the frontend of the
neural network with the help of Backpropagation algorithm. These one-hot encoded words
are plotted into word vectors. Based on the model, the process of feeding these words into the
model will be changed (Brownlee, 2017). If the model is a recurrent neural network, then
each of the word is considered as input in a sequence. Whereas, the model is multi-layer
perceptron, then these word vectors are concatenated before they fed as input to the model.
This method of learning an embedding layer requires a large amount of training data and is
time-consuming, but it will develop an embedding that is both suited to the particular text
data and the NLP task (Brownlee, 2017).

5.2.2 Word2Vec:
Word2Vec is a statistical approach for learning a solitary word embedding from a text
corpus quickly and effectively (Brownlee, 2017).

It was Introduced by Tomas Mikolov et al. at Google in 2013 as a way to improve the
efficiency of neural-network-based embedding training, and it has since become the de facto
standard for producing pre-trained word embedding (Brownlee, 2017).

The task also included analysing the learnt vectors and experimenting with vector
math on word representations. For example, taking the "man-ness" out of "King" and adding
"womenness" gives "Queen," which captures the connection "king is to queen as man is to
woman" (Brownlee, 2017)

The following are the two distinct learning models that are used as a part of word2vec
(Brownlee, 2017). CBOW Model (Continuous Bag-Of-Words) Continuous Skip-Gram Model

CBOW model is used to predict the current word based on its context. Whereas, for
Continuous Skip-Gram model is used to predict the current words based on the adjacent
words (Brownlee, 2017).

Both of these models are concerned with learning about words in the context of their
local use, which is specified by a window of nearby words. It is possible to configure this
window as a model parameter (Brownlee, 2017).

The main advantage of this approach is that high quality word embeddings can be
learnt quickly (due to time complexity and low space), this enables more dimensions to be
learned from considerably larger corpora of text (Brownlee, 2017).
5.3 Long Short-term Memory (LSTM):

LSTM came into the picture because of the drawbacks of simple RNN’s i.e..,
Vanishing Gradient problem, which was discussed in the previous chapter. To resolve this
issue, LSTM will use Gated mechanism, which can control the memorizing process (Singhal,
2020b). The

Gates that open and close will allow the information to be saved, written or read in
LSTM’s. Sigmoid ranges with values between 0 and 1 implement element-wise
multiplication using these gates. This Analog is appropriate for the back propagation, as it is
differentiable in nature (Singhal, 2020b).

5.3.1 Tanh Activation Function:

Tanh is an activation function that is not linear. Tanh function controls the values that
flow through the network, ranging the values between -1 and 1. There is a need for a function
that can retain its second derivative for a longer period of time in order to prevent information
fading (Singhal, 2020b). Values might become enormous in some cases, further resulting in
insignificance among them. In the below illustration, the number 5 stays inside the bounds
because of this tanh activation function (Singhal, 2020b).

5.1 Tanh Activation Fn (Singhal, 2020b)


5.3.2 Sigmoid Activation Function :

Sigmoid activation function is also non-linear function. The gate contains the sigmoid
activation function. The values of the sigmoid function ranges between 0 and 1 (Singhal,
2020b). This will assist the network by updating the information or by forgetting the
information. If the value is 1, then the information stays, similarly, If their product is 0, then
the information is forgotten. This aids the network, that which information is important to
keep and which to forget (Singhal, 2020b).

5.2 Sigmoid Action Fn (Singhal, 2020b)

5.3.3 LSTM Cell :


Inside a LSTM cell, there are three different gates which are forget gate, input gate
and an output gate. The Illustration of LSTM cell is given below (Singhal, 2020b).
5.3 LSTM Cell (Singhal, 2020b)

5.3.4 LSTM Conclusion :

To summarise the concept of LSTM, it contains three gates (forget gate, input gate
and an output gate). In order to determine whether prior information is relevant, the forget
gate must be used. Adding relevant information from the current step is controlled by the
input gate, and finalizing it is controlled by the output gate.
5.4 Language Translation using Transformers :

5.4.1 Transformers :

The Transformer was first introduced by (Vaswani et al., 2017).Parallel computing is


used by modern devices such as Graphics Processing Units (GPUs) and Tensor Processing
Units (TPUs) such as graphics processors to solve NMT problems. RNNs used to be the most
popular and powerful architecture for the Encoder-Decoder structure to solve NMT
problems.Because RNNs are sequential, they process words word by word and can thus be
parallelized, due to their sequential nature. Transformer uses a self-attention mechanism in
order to correct this shortcoming of RNNs. This allows the encoder and decoder to consider
every word of the input sequence (Nguyen, 2019). In the Transformer, each position is
encoded, self-attention is applied to both the encoder and decoder, and multi-head attention is
calculated enhancing the implementation of self-attention (Nguyen, 2019).

5.4.2 Self-Attention Mechanism :

The NMT self-Attention mechanism is capable of identifying the relationships


between words within the sentence (Nguyen, 2019).
5.4 Self-Attention

self-attention mechanism is shown in the above figure. In addition to looking at "I", "kicked",
and "ball" in the input sequence, the model can also answer three questions - "Who", "Did
what", and "To Whom" - to get a better understanding of the specific word "kicked"(Nguyen,
2019). As explained by (Vaswani et al., 2017), the mechanism used for attention is dot-
product attention, which can be described as follows:

Attention Formula

A matrix Q consists of a row and column matrix containing the set of queries packed
together and a K and a V matrix containing the required keys and values. Encoder-decoders
are typically hidden in both their query and key states. Keys and values are inputs. Based on
how much attention a corresponding key receives, the value represents a normalized weight
(Nguyen, 2019).

5.5 Self-Attention Layer

The encoder side of self-attention layer provides better representation for the input xt,
where t is the time step, that is generated by self-attention using all other inputs
x1,x2,x3,x4…….xn. where n is the length of the sequence (Nguyen, 2019).

The Transformer is more suitable for parallelization than RNNs because this work can
be done simultaneously for all input steps.

As another advantage, a self-attention layer connects all positions utilizing only O(1)
number of sequential operations, which is cheaper than using RNNs with a dimension of O(n)
(Nguyen, 2019).

xt is the input at time step t, that is being used as a query at the decoder. The keys and
values of the self-attention layer are obtained by combining all of the past queries x1,
x2,...,xt-1 (Nguyen, 2019).
5.6 Self-Attention Layer predicts at time step

5.4.3 Multi-Headed Attention:

By calculating multiple attention weighted sums of the values, the Multi-Head


Attention captures various aspects of the input rather than a single attention weighted sum.
Multiple independent attentions can be spliced together to obtain information on different
subspaces (Nguyen, 2019).

Each head transforms the input representation into a unique query, key and value.
MultiHeaded attention is calculated by calculating the scaled dot attention h times in parallel.
Afterward, the outputs are concatenated (Nguyen, 2019).
After that, one single linear transformation is applied to the input, as shown in Figure,
and it is then concatenated.

MultiHead Self Attention can distinguish related information from different


representation subspaces due to the randomly initialized query, key, value sets that are used
in this technique (Nguyen, 2019).

5.7 Multi-Head Attention


CHAPTER 6

EXPERIMENTATION

6.1 Data Pre-processing :

Dataset

For a language translation model, finding proper datasets is really important. After
thorough research there is a parallel corpus for both the languages (scionoftech, 2019).This
corpus contains approximately 300,000 sentences of the Tamil Language and the English
language. Once the corpus is downloaded, it is assigned to a variable. Apart from this, we are
taking the non-breaking prefixes (moses-smt, 2019). In both the languages are also imported
as mentioned below

Data Cleaning

Cleaning the data is the primary step in data pre-processing. Now, convert the non-
breaking prefixes from both the languages into lists. Whenever these non-breaking prefixes
appear in a sentence, they do not mark the end of the sentence. It would be better to have the
lists of non-breaking prefixes prepared as a list with a period at the end so it is easier to use. It
is shown below.
Procedure to remove Consecutive spaces from the corpus:

The corpus will be prepared by following the steps below.

 To determine if there are any non-breaking prefixes in the corpus, iterate over the
lists.
 Append “$$$” at the end of each prefix.
 Once after finding all the occurrences of periods, then there will be an immediate
appending of this alpha numeric “$$$” between the period and the character.
 By removing all the occurrences of “.$$$”. Then there won’t be any non-braking
periods.
 Now, these consecutives spaces will be replaced with single space.
 Final step is splitting the corpus into a list.
6.2 Text Tokenization :

For a neural network to process the information, the data should have to be in a
numerical form. So, one of the ways to convert a string into a text is by using tokenizer. Here,
in this project SubWordEncoder is used to create a tokenizer for the data. This Encoder
encodes the text into a number, which can be used for calculation. The vocabulary size of a
tokenizer is of 213 i.e., approximately 8,192 tokens.
6.3 Building the model :
Basic components required to build our model are

 Positional Encodings
 Self-Attention Layers
 Point- Wise Feed forward Network Layers

By using these components Multi layered Encoders and decoders are created.

The below image illustrates the transformer architecture. Here are the parts. There is a
multilayer encoder. It transmits its output to the decoder. From the decoder, the model output
is generated. The encoder and decoder inputs are preceded by embedded and positional
encoding. Technically, these steps are not part of the model, but they are necessary.
Additionally, a linear transformation and SoftMax functions are applied to the decoder
outputs.

6.1 Transformers Architecture (Vaswani et al., 2017)


6.4 Encoder :
The input is embedded using n Embedding to create an embedding vector to
uniquely represent each word token as well as closely relate similar words. Positional
encoding encodes a token based on the position in the input sequence instead of it's token
value. The encoder outputs a sequence of context vectors. Unlike the RNN where the token
being read is only influenced by the hiddens states of previous tokens, in the transformer
model, each token is influenced by all tokens in the sequence. This also means that the
entire input sentence can be processed simultaneously instead of word by word, allowing
for much more parallelism. The transformer model in the original paper uses static
embedding while current and state-of-the-art transformer NLP models such as BERT use
dynamic or learnable positional embeddings. As such, we will use learnable position
embeddings. After the input sequence is embedded, it is passed through the Multi-Head
Attention layer, which is the promiment aspect of a transformer model. Multiheaded
attention takes in a value, key, and query.

6.2 Attention as seen in the Diagram Below.

Multi-Headed attention are multiple scaled dot-product attention layers stacked upon
each other and concatenated, then passed through a dense layer. Multi-Headed attention
allows the transformer model to jointly deal with multiple subspace representations from
different positioned tokens.
6.5 Decoder :

The Decoder takes in the target value and applies token and positional encoding to it
aswell. The decoder also contains a Multi-Head Attention layer, however the scaled dot-
production attention layer in the Multi-Head Attention masks out all values that the softmax
activation deems unnecessary or illegal, hence the name Masked Multi-Head Attention
Layer. The output of the MMHAL is the query for the next regular Multi-Headed Attention
while the key and value are the outputs from the encoder (encoded inputs). The decoder then
passes the result through a Feed Forward Layer and then a classification Dense network for
final predictions

6.6 Python Files :

train.py

An executable python script that takes in parameters including hyperparameters for


the transformer model as well as training parameters. While running, the programs save the
model weights to a specified directory every epoch and displays training loss. Run this file as
follows:

python train.py --hyperparameters

--hyperparameters are a list of hyperparameters to call in order to properly execute train.py.


Each hyperparamter is to be entered in this format:

--data_directory data

followed by a space to seperate each hyperparameter entered. Please refer to the file to see
specific hyperparamters. NOTE: In order to train yourself, either download the proper
tgz files in the datasets section below and correct the script parameters or use your own
dataset and modify the train.py file to work with your dataset.
translate.py

An executable python script that (assuming default hyperparameters) takes in the


input text, input language, output language and returns the translation from the input
language to the output language. For example, here is a test run:

python translate.py --input_text "What is your name?" --input_lang english --


output_lang french

This command will translate the text "What is your name?" to French.

To use tranlate.py correctly, the model weights and dictionary files must follow the
following organization. In the saved_models directory, create a directory signifying the
translation model (eg. english2french) and save the models that translate from english to
french in said directory. Also save the dictionary files using pixel. If your cloning this repo
and don't want to train, then there is no need to do any of the steps above as all files are
in place.

models.py

Contains the component classes to build a Transformer model and includes the
Transformer Class. Also includes Feed-Forward Layer, Multi-Head Attention, Encoder
Layers, Encoder, Decoder Layers, and Decoder.

dictionary.py

creates a Dictionary class which keeps track of all words seen from the dataset in
each language and assigns a unique token to every new word.

utilities.py

contains utility functions to help with preprocessing and post processing data.
6.7 PURELY TESTING :

If you want to test the software without training or any other steps described above,
then follow the following steps:

Step 1:

Clone the Repository.

Step 2:

Ensure you have all the requirements necessary in the requirements.txt file. Main ones
are Pytorch and other math libraries such as Numpy.

Step 3:

Run the python script and entering the hyperparameters

For example,

Here are the list of possible input -> output pairs:

English -> French

English -> German

English -> Italian

English -> Portuguese

French -> English

Italian -> English

Portuguese -> English


6.8 DATASETS :

For this project, the European Parliament Proceedings Parallel Corpus 1996-2011 is
used. Note, the downloaded files are tgz files. In order to use them, please extract them and
name them according to the format you see in this repo, including appropriately expanding
names for convenient access. Link to dataset: https://www.statmt.org/europarl/

Reference to paper: http://homepages.inf.ed.ac.uk/pkoehn/publications/europarl.pdf

SAMPLES :

Since I do not know many of the langauges I have trained on the Transformer
model, I will be using more robust translators as comparison such as Google Translate.

English -> French

INPUT : "it is important to know."


PREDICTION : "il est important de savoir ."
LI TRANSLATE : "il est important de savoir."

INPUT: "what should I do?"


PREDICTION: "que je devrais faire ?"
LI TRANSLATE: "que devrais-je faire?"

Validation Datapoint from Dataset (Larger Sentence):

INPUT: "this debate and the amendment of the directive currently in force allow us to
incorporate differentiating elements which demonstrate the diversity of this Europe of ours."
PREDICTION: "ce debat et l amendement de la directive nous permet d integrer les
elements qui demontrent la diversite de notre europe ."
LI TRANSLATE:: " ce débat et l'amendement de la directive actuellement en vigueur nous
permettent d'intégrer des éléments de différenciation qui démontrent la diversité de cette
Europe qui est la nôtre."

As you can see with the example above, the prediction may not be word to word with
Google Translate results, but the prediction still maintains the semantic information and
context that was in the input.

English -> German

INPUT: "this is a short paragraph."


PREDICTION: "das ist ein kurzer absatz ."
LI TRANSLATE: "dies ist ein kurzer Absatz"

INPUT: "what is your name?"


PREDICTION: "was is’t ihr name ?"
LI TRANSLATE: "was ist ihr name?"

Italian -> English

INPUT: "oggi è una giornata bellissima."


PREDICTION: "today is a magnificent day ."
LI TRANSLATE: "today is a beautiful day."

INPUT: "la collaborazione è la chiave del successo."


PREDICTION: "cooperation is key to success ."
LI TRANSLATE: "collaboration is the key to success."

Portuguese -> English

INPUT: "é importante cuidar de sua saúde mental."


PREDICTION: "it is important to promote their mental health ."
LI TRANSLATE: "it is important to take care of your mental health."

INPUT: "você deve dormir uma boa quantidade de sono todos os dias."
PREDICTION: "sleep a good amount of sleep every day ."
LI TRANSLATE: "you should get a good amount of sleep every day."
CHAPTER 7

APPENDIX

Source code

Index.html

<!DOCTYPE html>

<html>

<head>

<title>Translator App</title>

<script src="https://cdn.tailwindcss.com"></script>

<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

<style>

.bubble {

position: absolute;

display: flex;

align-items: center;

justify-content: center;

border-radius: 50%;

width: var(--size, 30px);

height: var(--size, 30px);


background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent
70%);

color: rgba(255,255,255,0.7);

animation: float var(--speed, 15s) ease-in-out infinite;

animation-delay: var(--delay, 0s);

top: var(--y, 50%);

left: var(--x, 50%);

font-family: sans-serif;

transform: translate(0, 0);

@keyframes float {

0%, 100% { transform: translate(0, 0) rotate(0deg); }

25% { transform: translate(20px, -15px) rotate(5deg); }

50% { transform: translate(0px, -25px) rotate(0deg); }

75% { transform: translate(-20px, -15px) rotate(-5deg); }

/* Liquid blobs */

.liquid-translation-container {

perspective: 1000px;

transform-style: preserve-3d;

position: relative;

.liquid-blob {
position: absolute;

border-radius: 50%;

background: radial-gradient(circle at 30% 30%, var(--blob-color), rgba(139, 92, 246,


0.1));

filter: blur(1px);

mix-blend-mode: screen;

opacity: 0.5;

animation: morph 8s ease-in-out infinite;

.blob1 {

--blob-color: rgba(59, 130, 246, 0.8);

width: 60px;

height: 60px;

top: 10px;

left: 10px;

animation-delay: 0s;

.blob2 {

--blob-color: rgba(236, 72, 153, 0.8);

width: 70px;

height: 70px;

top: 20px;

right: 5px;
animation-delay: -2s;

.blob3 {

--blob-color: rgba(139, 92, 246, 0.8);

width: 55px;

height: 55px;

bottom: 15px;

left: 30px;

animation-delay: -4s;

@keyframes morph {

0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }

25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }

50% { border-radius: 50% 60% 50% 40% / 40% 30% 60% 50%; }

75% { border-radius: 40% 60% 70% 30% / 60% 40% 30% 70%; }

/* Text particles */

.text-particle-container {

position: absolute;

inset: 0;

animation: rotate3d 15s linear infinite;

transform-style: preserve-3d;

}
.text-particle {

position: absolute;

font-weight: bold;

color: white;

opacity: 0.8;

animation: pulse 3s ease-in-out infinite;

.tp1 { top: 30%; left: 30%; animation-delay: 0s; }

.tp2 { top: 20%; left: 65%; animation-delay: -0.5s; }

.tp3 { top: 65%; left: 25%; animation-delay: -1s; }

.tp4 { top: 70%; left: 70%; animation-delay: -1.5s; }

.tp5 { top: 50%; left: 50%; animation-delay: -2s; }

@keyframes pulse {

0%, 100% { transform: scale(1); opacity: 0.8; }

50% { transform: scale(1.2); opacity: 1; }

@keyframes rotate3d {

0% { transform: rotateY(0deg) rotateX(0deg); }

100% { transform: rotateY(360deg) rotateX(360deg); }

/* Connection lines */

.connection-line {

stroke: rgba(255, 255, 255, 0.2);


stroke-width: 0.5;

stroke-dasharray: 5;

animation: dash 10s linear infinite;

@keyframes dash {

to { stroke-dashoffset: 100; }

/* Progress bar */

.translation-progress-bar {

animation: progress 3s ease-in-out infinite alternate, shimmer 2s linear infinite;

background-size: 200% 100%;

@keyframes progress {

0% { width: 15%; }

100% { width: 85%; }

@keyframes shimmer {

0% { background-position: -200% 0; }

100% { background-position: 200% 0; }

About us.html
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>About Us - MultiLingual Translator</title>

<style>

body {

font-family: 'Arial', sans-serif;

line-height: 1.6;

margin: 0;

padding: 0;

background-color: #fffd7f;

.container {

max-width: 1200px;

margin: 0 auto;

padding: 2rem;

.header {

text-align: center;

padding: 2rem 0;

background-color: #ff51e8;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);

.content {

background-color: #a5f79d;

padding: 2rem;

margin: 2rem 0;

border-radius: 8px;

box-shadow: 0 2px 4px rgba(0,0,0,0.1);

.features {

display: grid;

grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

gap: 2rem;

margin-top: 2rem;

.feature-card {

background-color: #ff92c5;

padding: 1.5rem;

border-radius: 6px;

text-align: center;

h1 {
color: #333;

margin-bottom: 1rem;

h2 {

color: #444;

margin-bottom: 1rem;

</style>

</head>

<body>

<div class="header">

<h1>About Our Translation Service</h1>

</div>

<div class="container">

<div class="content">

<h2>Welcome to MultiLingual Translator</h2>

<p>We are dedicated to breaking down language barriers and facilitating global
communication through our advanced translation service. Our platform leverages state-of-
the-art machine translation technology to provide accurate and reliable translations across
multiple languages.</p>

<h2>Our Mission</h2>

<p>Our mission is to make communication accessible and seamless across different


languages and cultures. We believe that language should never be a barrier to understanding
and connecting with others.</p>
<h2>Supported Languages</h2>

<p>Our translation service currently supports translations between:</p>

<ul>

<li>English to Hindi</li>

<li>English to French</li>

<li>English to Arabic</li>

<!-- Add more languages as they become available -->

</ul>

<div class="features">

<div class="feature-card">

<h3>Fast Translation</h3>

<p>Get instant translations powered by advanced machine learning models</p>

</div>

<div class="feature-card">

<h3>Accurate Results</h3>

<p>Utilizing state-of-the-art OPUS-MT models for high-quality translations</p>

</div>

<div class="feature-card">

<h3>Free to Use</h3>

<p>Access our translation service without any cost</p>

</div>

</div>

<h2>Technology</h2>
<p>Our translation service is powered by the OPUS-MT (Open Parallel Universal
Speech) machine translation models, which are specifically trained for high-quality
translations between various language pairs.</p>

<h2>Contact Us</h2>

<p>Have questions or feedback? We'd love to hear from you! Please reach out to us
through our contact form or email.</p>

</div>

</div>

</body>

</html>

Contact us

<!DOCTYPE html>

<html>

<head>

<title>Contact Us - Translator App</title>

<script src="https://cdn.tailwindcss.com"></script>

<script src="https://unpkg.com/alpinejs" defer></script>

<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">

</head>

<body class="bg-gradient-to-r from-blue-50 to-cyan-50 min-h-screen p-4">

<div class="w-full max-w-4xl mx-auto">

<!-- Header -->


<div class="flex justify-between items-center bg-gradient-to-r from-blue-600 to-blue-
800 p-6 rounded-t-xl">

<button class="w-10 h-10 bg-white rounded-full hover:bg-blue-50 transition-all


duration-300 focus:outline-none focus:ring-2 focus:ring-blue-400 shadow-md hover:shadow-
lg flex items-center justify-center overflow-hidden">

<img src="/static/images/download.jpeg" alt="Translator Logo" class="w-6 h-6


object-contain">

</button>

<h1 class="text-white text-2xl font-bold tracking-wider">CONTACT US</h1>

<div class="flex space-x-3">

<a href="/" class="w-10 h-10 bg-white/20 rounded-full hover:bg-white/30


transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-white flex items-center
justify-center">

<i class="fas fa-home text-white"></i>

</a>

<a href="/aboutus.html" class="w-10 h-10 bg-white/20 rounded-full hover:bg-


white/30 transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-white flex
items-center justify-center">

<i class="fas fa-info text-white"></i>

</a>

</div>

</div>

<!-- Main Content -->

<div class="bg-white rounded-b-xl shadow-2xl p-8">


<div class="grid grid-cols-1 md:grid-cols-2 gap-8">

<!-- Contact Information -->

<div class="space-y-6">

<h2 class="text-2xl font-bold text-blue-800">Get in Touch</h2>

<p class="text-gray-600">Have questions about our translation service? We're


here to help!</p>

<div class="space-y-4">

<div class="flex items-center space-x-4">

<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-


center">

<i class="fas fa-envelope text-blue-600"></i>

</div>

<div>

<h3 class="font-semibold text-gray-800">Email</h3>

<p class="text-gray-600">support@translator.com</p>

</div>

</div>

<div class="flex items-center space-x-4">

<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-


center">

<i class="fas fa-phone text-blue-600"></i>

</div>

<div>

<h3 class="font-semibold text-gray-800">Phone</h3>


<p class="text-gray-600">+91 123-4567-890</p>

</div>

</div>

<div class="flex items-center space-x-4">

<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-


center">

<i class="fas fa-map-marker-alt text-blue-600"></i>

</div>

<div>

<h3 class="font-semibold text-gray-800">Location</h3>

<p class="text-gray-600">123 Translation Street<br>Language City, LC


12345</p>

</div>

</div>

</div>

<!-- Social Media Links -->

<div class="pt-6">

<h3 class="font-semibold text-gray-800 mb-4">Follow Us</h3>

<div class="flex space-x-4">

<a href="#" class="w-10 h-10 bg-blue-100 rounded-full flex items-center


justify-center hover:bg-blue-200 transition-all duration-300">

<i class="fab fa-twitter text-blue-600"></i>

</a>
<a href="#" class="w-10 h-10 bg-blue-100 rounded-full flex items-center
justify-center hover:bg-blue-200 transition-all duration-300">

<i class="fab fa-facebook-f text-blue-600"></i>

</a>

<a href="#" class="w-10 h-10 bg-blue-100 rounded-full flex items-center


justify-center hover:bg-blue-200 transition-all duration-300">

<i class="fab fa-linkedin-in text-blue-600"></i>

</a>

</div>

</div>

</div>

App.py

# Initialize translation service

translation_service = TranslationService()

translation_service.initialize()

@app.route('/api/detect', methods=['POST'])

def detect_language():

"""API endpoint for language detection."""

data = request.json

if not data or 'text' not in data:

return jsonify({"error": "Missing 'text' parameter"}), 400

result = translation_service.detect_language(data['text'])

return jsonify(result)
@app.route('/api/translate', methods=['POST'])

def translate_text():

"""API endpoint for text translation."""

data = request.json

if not data or 'text' not in data:

return jsonify({"error": "Missing 'text' parameter"}), 400

source_lang = data.get('source_lang')

target_lang = data.get('target_lang', 'en')

result = translation_service.translate_text(

text=data['text'],

source_lang=source_lang,

target_lang=target_lang

return jsonify(result)

@app.route('/api/sentiment', methods=['POST'])

def analyze_sentiment():

"""API endpoint for sentiment analysis."""

data = request.json

if not data or 'text' not in data:

return jsonify({"error": "Missing 'text' parameter"}), 400

original_lang = data.get('lang')

result = translation_service.analyze_sentiment(

text=data['text'],
original_lang=original_lang

return jsonify(result)

@app.route('/api/identify', methods=['POST'])

def identify_text():

"""API endpoint for text identification/classification."""

data = request.json

if not data or 'text' not in data:

return jsonify({"error": "Missing 'text' parameter"}), 400

categories = data.get('categories')

original_lang = data.get('lang')

result = translation_service.identify_text(

text=data['text'],

categories=categories,

original_lang=original_lang

return jsonify(result)

@app.route('/api/languages', methods=['GET'])

def get_languages():

"""API endpoint to get supported languages."""

languages = translation_service.get_supported_languages()

return jsonify({"languages": languages})

@app.route('/api/pairs', methods=['GET'])
def get_pairs():

"""API endpoint to get supported language pairs."""

pairs = translation_service.get_supported_pairs()

return jsonify({"pairs": pairs})

@app.route('/api/health', methods=['GET'])

def health_check():

"""API endpoint for health check."""

return jsonify({

"status": "ok",

"message": "Translation service is running",

"languages_supported": len(translation_service.get_supported_languages()),

"pairs_supported": len(translation_service.get_supported_pairs())

})

def main():

"""Main entry point for the application."""

parser = argparse.ArgumentParser(description="Multilingual Translation Backend


Service")

parser.add_argument("--host", type=str, default="0.0.0.0", help="Host to bind the server


to")

parser.add_argument("--port", type=int, default=5000, help="Port to bind the server to")

parser.add_argument("--debug", action="store_true", help="Run in debug mode")

args = parser.parse_args()

# Initialize translation service


logger.info("Starting translation service...")

translation_service.initialize()

# Run Flask app

logger.info(f"Starting Flask server on {args.host}:{args.port}")

app.run(host=args.host, port=args.port, debug=args.debug)

if _name_ == "_main_":

main()
OUTPUT

Logo
CHAPTER 7

RESULT ANALYSIS

We develop this application for desktop application. Here we are integrating the
speech to speech, text to text, speech to text and language translator in one system so user
doesn’t have to download for the different application. You can also give voice input to
translate language.

TECHNOLOGY:

⚫ We Important Libraries and python modules.

⚫ Python frontend

⚫ API calls

⚫ Speech Recognition module.

⚫ Flask for GUI

⚫We Use VS Code Software as code editor

7.1 MODULES:

USER MODULE

 Text/speak: that he/she want to translate.


 Language change: According to understanding they can change language of the
translation.
CHAPTER 8

CONCLUSION

In this proposed system, we implemented the system for user who phasing
problems of language barrier and also it user interface is also user friendly so that user
can easily interact with this system . so it automatically reduce the user task for
understanding the languages for communication. Translation is not merely at changing
words, but also transferring of cultural equivalence with the culture of the original
language and the recipient of that language as well as possible.

The better translation must be accepted by all people in logic and based on
fact; thus, the message which contained in the source language (SL) can satisfy the
target language (TL) reader with the information within. When you understand the
importance of translation for everyone, you will be able to see it as a necessary and
worthy investment.

The primary objective of this study was to build a language translation model
that uses machine learning to translate from Tamil to English. As many studies have
focused on the English language and other European languages in the past, However,
there aren't any existing studies done on the Tamil language.

So, the Tamil language has been chosen for this research. The neural network
architecture used for this research, that made this project success, is by using
Transformers for language translation. It translates own sentences of the Tamil
language into the English. Moreover, in this research the language translation using
Transformer model is providing a bit better result when compared to Google
Translator from (Tamil to English).

The training time, the model took to train the dataset is almost 12.5 hours. And
the accuracy of the translation is quite good. However, there are few drawbacks in the
translation, this can be eradicated by researching further.
CHAPTER 9

FUTURE SCOPE

However to make this system more precise and useful for a wide range of target
audience, it demands some further improvements Further we are aiming at following
improvements: To take input text from an image of printed English text by implementing
character recognition. Presently we are only able to take manual input through virtual
keyboard. The system can be further extended to include more languages and possibly
dialects.

Languages such as Tamil need more research, since they are different from English
and other languages. Due to the lack of parallel datasets, they are unable to develop several
natural language processing tasks, particularly translation. The building of datasets will
therefore support and help researchers develop new and reliable models. Further research
might need to build Tamil datasets since there are not sufficient datasets for these languages.
This would encourage a great deal of research in this area since datasets are always a barrier
when it comes to NLP tasks. However, when we use google translate, we would get a good
result out of existing language i.e., If we ask the google translator to translate from the
English to Tamil, we will get a good translation which is quite good. If any foreigners visit
India, they would know what to talk, what to say. However, there are several immigrants who
want to have a better life and want to understand how to speak in English, they will use these
translations really well. When we try to translate other way around i.e., from Tamil to
English, the translation is not as good as the translation from English to Tamil. Moreover,
further research and experimentation on the Tamil translation would be very useful. In this 69
Bournemouth University, Department of Computing and Informatics, Final Year Project
regard, I would encourage others to improve our existing models.
REFERENCES

 Sireesh Haang Limbu, “Direct Speech to Speech Translation Using Machine


Learning”, December 2020
 S. Venkateswarlu, D. B. K. Kamesh , J. K. R. Sastry and Radhika Rani, “ Text to
Speech Conversion”, 23 September 2020
 Chris Piech, Sami Abu-El-Haija, “Auto-Translation for Localized Instruction”, Sep
2019
 Sagar Patil, Mayuri Phonde, Siddharth Prajapati , “Multilingual Speech and Text
Recognition and Translation using Image”, April-2020

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy