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

Language Translator Python

Language translator code
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)
65 views

Language Translator Python

Language translator code
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/ 25

||JAI SRI GURUDEV||

ADICHUNCHANAGIRI UNIVERSITY

FACULTY OF ENGINEERING, MANAGEMENT & TECHNOLOGY


(BGS INSTITUTE OF TECHNOLOGY)
BG Nagara-571448, Nagamangala Taluk,
Mandya District, Karnataka (INDIA)

A Mini Project
Report On
“LANGUAGE TRANSLATOR USING PYTHON”
Submitted in partial fulfilment for
academic year 2024-2025

Bachelor of Engineering
in
Computer Science And Engineering

Submitted by,
KARNIKA CHINMAYI M R (22CSE065)
KEERTHAN AIYAPPA T S (22CSE067)
Under the guidance of:
Mrs.Ancy Y Das,
Assistant Professor, Dept. of CSE,
BGSIT, BG Nagara,
1
|| Jai Sri Gurudev||
ADICHUNCHANAGIRI UNIVERSITY

FACULTY OF ENGINEERING, MANAGEMENT & TECHNOLOGY


(BGS INSTITUTE OF TECHNOLOGY)
BG Nagara-571448, MANDYA

Department of Computer Science And Engineering

CERTIFICATE
This is to certify that the mini project entitled “LANGUAGE
TRANSLATOR USING PYTHON” is a bonafide work carried by
Ms.KARNIKA CHINMAYI M R, bearing USN:22CSE067 and
KEERTHAN AIYAPPA TS bearing USN:22CSE067 the students of B G S
INSTITUTE OF TECHNOLOGY, B G Nagara in partial fulfillment of
Bachelor of Engineering in Computer Science And Engineering, of
Adichunchanagiri University during the academic year 2024-2025. It is certified
that all correction / suggestions indicated for internal assessment have been
incorporated in the report deposited in the department library.

Mrs.ANCY Y DAS Dr. SHASHIKALA SV


Assistant Professor Professor & HOD,

Dept.of CSE Dept.of CSE

BGSIT, B G Nagara BGSIT, B G Nagara


2
ACKNOWLEDGEMENT

At first, we would like to thank the Divine Soul PADMABHUSHAN SRI DR.
BALAGANGADARANATHA MAHASWAMIJI, Founder President, Sri Adichunchanagiri Math
and SRI DR. NIRMALANANDANATHA MAHASWAMIJI, President, Adichunchanagiri
Shikshana Trust, and Chancellor, Adichunchanagiri University, for providing us with such
excellent facilities and Lectures, without which, this project work could not have acquired
the shape it has now done.
I would like sincere gratitude to our beloved principal DR. B N SHOBHA, Dean &
Principal, BGSIT, B.G Nagara for providing the necessary facilities and support, thus
making it possible for us to obtain the necessary resources required to complete this mini
project work.
My sincere thanks to DR. SHASHIKALA SV, Professor and Head of Department,
CSE, BGSIT, B G Nagara, Mandya, for giving us a chance to carry out and present our
project work with all the support and facilities
like to thank Mrs.ANCY Y DAS, Assistant Professor, Department of CSE, BGSIT, BG
Nagara, Mandya for providing me enough technical guidance and necessary facilities and
support. our honorable guide who stood as an excellent guide to carry out my work has been
always available expensive evaluator for the creation and correction of the report towards this
work.
My heartfelt gratitude to all the teaching and non-teaching faculty of Computer
Science And Engineering Department, BGSIT, BG Nagara, Mandya, for their support and
guidance towards the completion of our mini project work.
Finally, I would also extend my heartfelt thanks to my family members, classmates,
friends and well-wishers for their support and encouragement throughout this effort.

Karnika Chinmayi MR (22CSE065)


Keerthan Aiyappa TS (22CSE067)

3
CONTENTS
Title Page No.
ACKNOWLEDGMENT i
ABSTRACT ii
CHAPTER 1
INTRODUCTION7 1
1.1 Existing system 2
1.2Limitations of Existing system 2
1.3Objectives 3
1.4 Scope 4-5
CHAPTER 2
LITERATURE SURVEY 6-8
CHAPTER 3
SYSTEM DESIGN & ANALYSIS 9-10
3.1 Data Flow Diagram 9-10
CHAPTER 4
IMPLEMENTATION 11-15
4.1 Requirements 11
4.2 Source Code 12-15
CHAPTER 5
RESULTS AND DISCUSSION 16-17
CONCLUSION 18
REFERENCES 19

4
ABSTRACT

A language translator is a mobile application that can be utilized for translating from one
language to another. The problem of language difference has hindered effective information
communication over the years. This traditional approach used for solving the problem of
language differences has not been productive and favorable. The study develops an android
language converter app in order to make learning and language translation easy and
facilitates stress-free communication. The system will also be able to evaluate language
translation to determine their suitability for everyday conversation. The proposed system
employs a neural network architecture trained on vast multilingual datasets to accurately
translate text between multiple languages. Leveraging recent advancements in natural
language processing, the translator demonstrates impressive proficiency in preserving
context, tone, and idiomatic expressions across languages. Additionally, the system
incorporates feedback mechanisms to continuously improve translation quality over time.
The versatility and accuracy of this multilingual language translator make it a valuable tool
for fostering cross-cultural understanding and facilitating seamless communication on a
global scale.
LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CHAPTER 1.

INTRODUCTION
In our increasingly interconnected world, effective communication across linguistic
boundaries is essential for fostering collaboration, understanding, and progress. However,
the diversity of languages spoken worldwide presents a significant challenge for individuals
and organizations seeking to communicate across borders. Language barriers can impede
the exchange of ideas, limit opportunities for cooperation, and hinder cultural exchange.
Language translation technologies have emerged as a vital solution to this challenge,
enabling individuals and businesses to overcome linguistic barriers and engage with people
from diverse backgrounds. Traditional translation methods, such as manual translation by
human linguists, have long been the primary means of bridging language gaps. However,
these methods are often time-consuming, costly, and may not always be available for less
widely spoken languages.

In recent years, advances in artificial intelligence, particularly in the field of natural


language processing (NLP), have revolutionized the landscape of language translation.
Machine learning algorithms, particularly neural network-based models, have demonstrated
remarkable capabilities in understanding and generating human-like text. These advancements
have paved the way for the development of sophisticated language translation systems that
can accurately and efficiently translate text between multiple languages. This paper explores
the development and capabilities of a cutting-edge multilingual language translator powered
by advanced machine learning techniques. We examine the underlying principles of neural
network-based translation models and discuss how they enable accurate and contextually
relevant translations across a wide range of languages. Additionally, we explore the potential
applications and implications of such technology in facilitating cross-cultural communication,
enhancing accessibility, and driving global connectivity.

Dept. of CSE, BGS Page 1


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

1.1 Existing System


The existing systems for language translation primarily rely on statistical and rule-based
approaches or early neural network architectures. These systems often struggle with
accurately capturing context, handling idiomatic expressions, and providing fluent
translations, especially for less common language pairs. They may also have limited
scalability and flexibility in adapting to new languages or evolving linguistic patterns.
Additionally, the user interfaces and accessibility features of existing systems may vary,
impacting the user experience and usability for different user groups.

1.2 Limitations of Existing system

Cultural context is difficult to capture, which


1. Context and Nuance:
can lead to translations that are technically correct but culturally
inappropriate or confusing.

2. Accuracy and Reliability: Words with multiple meanings (polysemous words) can
lead to incorrect translations if the context isn’t properly understood.

3. Specialized Jargon: Technical Fields such as medicine, law, or engineering have


specialized jargon that might not be accurately translated without domain-specific
data.

4. Language Pair Coverage: Many translation systems are focused on major world
languages and often lack support or have poor accuracy for less commonly spoken
languages.

5. Syntax and Grammar: Proper handling of gendered language, formality levels, and
other grammatical nuances can be difficult.

6. Pragmatic Understanding: Translating not just the words, but the speaker's intent
and tone, is challenging. This can lead to translations that miss the subtleties of
politeness, humor, or sarcasm.

7. Real-time Translation: Real-time translation systems can suffer from latency,


making fluid conversation difficult.

Dept. of CSE, BGS Page 2


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

1.3 Objectives
o Accuracy: Develop a language translator with high accuracy in translating
text between multiple languages, ensuring that the translated output preserves
the meaning, context, and nuances of the original text.

o Efficiency: Create a translator that can efficiently process and translate text in
real-time, minimizing latency and enabling seamless communication across
linguistic barriers.

o Multilingual Support: Support a wide range of languages to accommodate


diverse communication needs, including both widely spoken languages and
those with fewer resources.

o Context Preservation: Ensure that the translator can accurately preserve the
context, tone, and style of the original text, including idiomatic expressions,
cultural references, and colloquialisms.

o Adaptability: Develop a translator that can adapt to different domains,


registers, and styles of language, catering to various communication
scenarios, such as formal documents, casual conversations, and technical
content.

o User-Friendly Interface: Design a user-friendly interface that is intuitive and


easy to use, enabling individuals with varying levels of technological
proficiency to access and utilize the translation service effectively.

o Accessibility: Ensure that the translator is accessible to a wide range of users,


including those with disabilities or special needs, by providing support for
alternative input methods, text-to-speech, and other accessibility features.

Dept. of CSE, BGS Page 3


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

1.4 Scope
1. Research Scope:

• Investigating how syntactic and grammatical rules impact translation accuracy.


• Exploring methods to better capture the meaning of sentences and phrases.
• Studying how context influences translation and developing models that
understand contextual nuances.
• Advancing neural architectures like Transformers (e.g., BERT, GPT, T5) for
more accurate translations.
• Enhancing encoder-decoder models, including attention mechanisms and
recurrent neural networks (RNNs, LSTMs).
• Applying pre-trained models to new languages or domains with minimal additional
training.

2. Development Scope:

• Gather and analyze requirements from stakeholders to understand the necessary


features and performance metrics.
• Gather parallel corpora (bilingual text data) for training and evaluation.
• Remove noise and inconsistencies from the data to improve quality.
• Split text into words, phrases, or subword units.

3. Application Scope:

• Communication
• Business and Commerce
• Travel and Tourism
• Healthcare
• Education
• Media and Government
• Legal and Government
• Social Media
Dept. of CSE, BGS Page 4
LANGUAGE TRANSLATOR USING 2023-24
PYTHON

4. Interdisciplinary Scope:

• Understanding sentence structure and meaning to improve translation accuracy


• Core technology behind language translation, involving tokenization, parsing, and
semantic analysis.
• Training models to understand and generate human language.
• Analyzing large datasets to improve translation models and evaluate performance.
• Translating spoken language and accounting for pronunciation and intonation.
• Designing user-friendly interfaces for translation tools.
• Making translation technologies accessible to users with disabilities.
• Facilitating understanding and exchange between different cultures through translation.
• Adapting translations to fit cultural norms and practices.

Dept. of CSE, BGS Page 5


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CHAPTER 2.

LITERATURE SURVEY

1. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio (2014)


o Title: "Neural Machine Translation by Jointly Learning to Align and Translate"
o Summary: This seminal paper introduced the attention mechanism, which
significantly improved the performance of neural machine translation systems
by allowing the model to focus on relevant parts of the input sentence during
translation.

2. Ashish Vaswani et al. (2017)


o Title: "Attention is All You Need”
o Summary: This paper introduced the Transformer model, a novel architecture
for sequence transduction tasks such as machine translation. The Transformer
model achieved state-of-the-art results in machine translation without recurrent
or convolutional layers, demonstrating the effectiveness of self-attention
mechanisms.

3. Melvin Johnson et al. (2017)


o Title: "Google's Multilingual Neural Machine Translation System Enabling
Zero-Shot Translation”
o Summary: This paper describes Google's Multilingual Neural Machine
Translation system, which is capable of translating between multiple
languages without explicitly training for each language pair. The system
demonstrates impressive zero-shot translation capabilities, highlighting the
potential for multilingual translation models.

4. Guillaume Lample et al. (2018)


o Title: "Unsupervised Machine Translation Using Monolingual Corpora Only"
o Summary: This paper presents an approach to unsupervised machine
Dept. of CSE, BGS Page 6
LANGUAGE TRANSLATOR USING 2023-24
PYTHON

translation, where the model learns to translate between languages without


parallel corpora. Instead, the model leverages monolingual corpora in both
source and target languages, demonstrating promising results in low-resource
translation scenarios.

5. Angela Fan et al. (2019)


o Title: "Facebook AI's WMT19 News Translation Task Submission"
o Summary: This paper describes Facebook AI's submission to the WMT19
News Translation Task, showcasing advancements in neural machine
translation techniques. The system incorporates back-translation, data
augmentation, and ensemble modeling to achieve state-of-the-art
performance on multiple language pairs.

6. Colin Cherry et al. (2020)


o Title: "Massively Multilingual Neural Machine Translation"
o Summary: This paper explores the challenges and opportunities in building
massively multilingual neural machine translation systems. By training on a
large

7. Philipp Koehn (2009)

o Title: "Statistical Machine Translation"


o Summary: This book provides a comprehensive overview of statistical
machine translation techniques, covering the foundational principles,
algorithms, and evaluation methods. It serves as a fundamental resource for
understanding the evolution of machine translation systems.

8. Felix Stahlberg and Bill Byrne (2020)

o Title: "Recent Advances in Neural Machine Translation”


o Summary: This survey paper summarizes recent developments in neural
machine translation, including techniques for low-resource languages,

Dept. of CSE, BGS Page 7


LANGUAGE TRANSLATOR USING 2023-24
PYTHON
domain

Dept. of CSE, BGS Page 8


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

adaptation, and multilingual translation. It also discusses challenges such as


dealing with rare words and improving translation quality.

9. George A. Miller (1993)

o Title: "A Survey of Machine Translation: Its History, Current Status, and
Future Prospects"
o Summary: While an older publication, this survey provides valuable insights
into the historical development of machine translation, including rule-based
and statistical approaches. It discusses the challenges faced by early
translation systems and offers perspectives on future directions.

10. Andrei Popescu-Belis et al. (2021)

o Title: "Advances in Multilingual and Multimodal Neural Machine Translation"


o Summary: This edited volume presents cutting-edge research on multilingual
and multimodal neural machine translation. It covers topics such as zero-shot
translation, cross-lingual transfer learning, and integration of visual
information, offering insights into the latest developments in the field.

Dept. of CSE, BGS Page 9


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CHAPTER 3.

SYSTEM DESIGN & ANALYSIS


3.1 Block Diagram

Fig 1: Block Diagram of Language


Translator

This flowchart outlines a process for translating text using a database. Here's a
step- by-step explanation of the flow:

Dept. of CSE, BGS Page 10


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

1. Start: The process begins.

2. Choose Language: The user selects the language into which they want their text
translated.

3. User enters the text that is to be translated: The user inputs the text they want to
be translated.

4. Matches with database: The system checks if the entered text has a match in the
translation database.

• If there is a match, the system proceeds to "Display translated Text".


• If there is no match, the system proceeds to "Display letter by letter".

5. Display translated Text: The system displays the translated text from the database.

6. Display letter by letter: If no match is found, the system translates and displays
the text letter by letter.

7. Input another text: The user is asked whether they want to input another text.

If yes, the process loops back to "Choose Language".

If no, the process ends.

8. End: The process is complete.

Dept. of CSE, BGS Page 11


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CHAPTER 4.

SYSTEM IMPLEMENTATION

4.1 REQUIREMENTS
Hardware Requirements:
1. Processor: Any modern dual-core CPU

2. RAM: 4 GB

3. Storage: 10 GB

4. Graphics: Integrated graphics is sufficient

5. Operating System: Any modern OS (Windows, macOS, Linux)

Software Requirements:
1. Python: 3.7 or higher

2. Libraries:

- transformers
- torch or tensorflow
- numpy
- pandas
- scikit-learn
- sentencepiece (for tokenization)
- CUDA (for GPU support): CUDA Toolkit 11.x

Dept. of CSE, BGS Page 12


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

4.2 Source Code


from tkinter import *
import tkinter as tk
from tkinter import ttk
from googletrans import Translator
from tkinter import messagebox

# Creating Tkinter Scaffold


root = tk.Tk()
root.title('Langauge Translator')
root.geometry('530x330')
root.maxsize(530, 330)
root.minsize(530, 330)

# Function to translate using the translator package

def translate():
language_1 = t1.get("1.0", "end-1c")
cl = choose_langauge.get()

if language_1 == '':
messagebox.showerror('Language Translator', 'please fill the
box') else:
t2.delete(1.0, 'end')
translator = Translator()
output = translator.translate(language_1, dest=cl)
t2.insert('end', output.text)
Dept. of CSE, BGS Page 13
LANGUAGE TRANSLATOR USING 2023-24
PYTHON

# Function to clear the input fields


def clear():
t1.delete(1.0, 'end')
t2.delete(1.0, 'end')

# SelectBox 1 for auto detected language


auto_detect_language = tk.StringVar()
auto_detect = ttk.Combobox(
root,
width=20,
textvariable=auto_detect_language,
state='readonly',
font=('verdana', 10, 'bold'),
)

auto_detect['values'] = ('Auto Detect', )

auto_detect.place(x=30, y=70)
auto_detect.current(0)

# SelectBox 2 for selected language


language_selected = tk.StringVar()
choose_langauge = ttk.Combobox(root,
width=20,
textvariable=language_selected,

Dept. of CSE, BGS Page 14


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

state='readonly',
font=('verdana', 10, 'bold'))

# List of available language options for


translation choose_langauge['values'] = (
'Afrikaans', 'Albanian', 'Arabic', 'Armenian', ' Azerbaijani', 'Basque', 'Belarusian', 'Bengali',
'Bosnian', 'Bulgarian', ' Catalan', 'Cebuano', 'Chichewa', 'Chinese', 'Corsican', 'Croatian', '
Czech', 'Danish', 'Dutch', 'English', 'Esperanto', 'Estonian', 'Filipino', 'Finnish', 'French',
'Frisian', 'Galician', 'Georgian', 'German', 'Greek', 'Gujarati', 'Haitian Creole', 'Hausa',
'Hawaiian', 'Hebrew', 'Hindi', 'Hmong', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish',
'Italian', 'Japanese', 'Javanese', 'Kannada', 'Kazakh', 'Khmer', 'Kinyarwanda', 'Korean',
'Kurdish', 'Kyrgyz', 'Lao', 'Latin', 'Latvian', 'Lithuanian', 'Luxembourgish', 'Macedonian',
'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Myanmar',
'Nepali', 'Norwegian' 'Odia', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian',
'Russian', 'Samoan', 'Scots Gaelic', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak',
'Slovenian', 'Somali', 'Spanish', 'Sundanese', 'Swahili', 'Swedish', 'Tajik', 'Tamil', 'Tatar',
'Telugu', 'Thai',
'Turkish', 'Turkmen', 'Ukrainian', 'Urdu', 'Uyghur', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa'
'Yiddish', 'Yoruba', 'Zulu',
)

choose_langauge.place(x=290, y=70)
choose_langauge.current(0)

# To store Input Text


t1 = Text(root, width=30, height=10, borderwidth=5, relief=RIDGE)
t1.place(x=10, y=100)

# To store translated Text


t2 = Text(root, width=30, height=10, borderwidth=5, relief=RIDGE)
t2.place(x=260, y=100)

button = Button(root,
Dept. of CSE, BGS Page 15
LANGUAGE TRANSLATOR USING 2023-24
PYTHON

text="Translate",
relief=RIDGE,
borderwidth=3,
font=('verdana', 10, 'bold'),
cursor="hand2",
foreground='Green',
command=translate)
button.place(x=150, y=280)

clear = Button(root,
text="Clear",
relief=RIDGE,
borderwidth=3,
font=('verdana', 10, 'bold'),
cursor="hand2",
foreground='Red',
command=clear)
clear.place(x=280, y=280)

root.mainloop()

Dept. of CSE, BGS Page 16


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CHAPTER 5.

RESULT & DISCUSSION

Fig. Initial screen of Language Translator

Dept. of CSE, BGS Page 17


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

Fig. Example 1

Fig. Example 2

Dept. of CSE, BGS Page 18


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

CONCLUSION
In the existing system, we have google translator which utilizes internet

connectivity whereas internet may not be available all the time and there are also

many android application available that may not support all the functionalities like

scanning text, speech recognition and translates the text and which are applicable for

specific and limited languages which are not useful for all the users. So here in the

proposed system where we will be implementing translation with support all the

functionalities like scanning text, speech recognition and translates the text and

includes the languages which are popular in our country as well as popular all over the

world. The advantage of this application is it doesn’t require internet connectivity.

Dept. of CSE, BGS Page 19


LANGUAGE TRANSLATOR USING 2023-24
PYTHON

REFERENCE

[1] Pramudita, Y. D., Putro, S. S., Wahyudi, R. N., Suzanti, I. O., & Solihin, F. (2020).
RESTful Web Service for Madurese and Indonesian Language Translator Applications
on Android Devices. 2020 6th Information Technology International Seminar (ITIS).

[2] Priya, L., Sathya, A., & Raja, S. K. S. (2020). Indian and English Language to Sign
Language Translator- an Automated Portable Two Way Communicator for Bridging
Normal and Deprived Ones. 2020 International Conference on Power, Energy, Control
and Transmission Systems (ICPECTS).

[3] Fong, Sim Liew; Elfaki, Abdelrahman Osman; bin Md Johar, Md Gapar; Aik,
Kevin Loo Teow (2017). [IEEE 2011 5th Malaysian Conference in Software
Engineering (MySEC) - Johor Bahru, Malaysia (2011.12.13-2011.12.14)] 2011
Malaysian Conference in Software Engineering - Mobile language translator.

[4] Image text to speech conversion in the desired language by translating with
Raspberry Pi ,H Ritika, Nithya Santoshi 2016 IEEE International Conference on
Computational Intelligence and Computing Research(ICCIC).

[5] Lahoti, S., Kayal, S., Kumbhare, S., Suradkar, I., & Pawar, V. (2018, July).
Android- based American sign language recognition system with skin segmentation and
SVM. In 2018 9th International Conference on Computing, Communication, and
Networking Technologies (ICCCNT).

[6] Evelyn, C. C., Bennett, E. O., & Taylor, O. E. (2019). A Natural Language
Processing System for English to Igbo Language Translation in Android.
INTERNATIONAL JOURNAL OF COMPUTER SCIENCE AND
MATHEMATICAL THEORY.

[7] Hakkun, R. Y., & Baharuddin, A. (2015, September). Sign language learning based
on Android for deaf and speech-impaired people. In 2015 International Electronics
Symposium .
Dept. of CSE, BGS Page 20

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