AIML Project Report
AIML Project Report
AIML Project Report
A REALTIME TRANSLATOR
A PROJECT REPORT
Submitted by
Aman (21BCS10278)
Abhinav(21BCS10439)
Vishal Yadav(21BCS10426)
BACHELOR OF ENGINEERING
IN
Chandigarh University
NOVEMBER 2023
CERTIFICATE
This is to certify that the S.E. mini-project entitled “Language Translator ” is a bonafide
fulfilment of the requirement for the award of the degree of “AIML Project” during the
5th semster.
Er. Pragya
Supervisor
Declaration
We declare that this written submission represents our ideas in our own words
and where others’ ideas or words have been included, we have adequately cited
and referenced the original sources. We also declare that we have adhered to all
principles of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in our submission. We
understand that any violation of the above will cause disciplinary action by the
Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when
needed.
Signature
AMAN 21BCS10278
Signature
Abhinav 21BCS10439
Signature
Vishal Yadav 21BCS10426
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 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.
Contents:
Table of Contents
Abstract v
Chapter 1 Introduction 1
1.1 Motivation
1.3 Objectives
1.4 Scope
3.2 Implementation 4
3.2.1 Algorithm/Flowchart 6
3.2.2 Dataset 7
4.2 Implementation 4
List of Tables
3.2 Implementation 4
4.3 Conclusion 12
List of Abbreviation
1.3 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 where we can learn a skills
by communicating.
• To perform and translate our native language.
1.4 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.
• Not everyone speak English ,so Language Translator is helpful for us to translate
our native language.
1
Chapter 2. REVIEW OF LITERATURE
3. Auto-Translation for Chris Piech, Sep 2019 The main translation model
Localized Instruction Sami Abu-El- along with specific areas of
Haija future work that has been
mentioned in this report
can be used for studies in
language translation using
utterances.
2
Chapter 3. PROPOSED SYSTEM
3
3.2 Implementation
1. Import Modules
We import ttk modules from tkinter library and Translator, LANGUAGES modules from
googletrans library, speech recoginition module, gtts module.
4. Define Combobox to select the language users can pick a seperate language for
both input data and to translate their data.
language gets all the values from the ‘LANGUAGES’ dictionary in the form of a list.
ttk.Combobox() widget is a class of ttk modules. It is a drop-down list, which can hold multi-
value and show one item at a time.
Combobox is useful to select one option from many option.
5. Define Function
The Translate function will translate the message and give the output. src gets the
language selected as input text language dest gets the language select to translate text
gets the input text entered by the user.”1.0″ means that the input should be read from
zero characters to line one
4
The END part means to read the text until the end is reached translator =
Translator() used to create a Translator class object Output_text.delete(1.0, END)
delete all the text from line one to end
Output_text.insert (END, translated.text) will insert the translated text in Output_text
SOURCE TARGET
LANGUAGE LANGUAGE
5
3.2.1 Algorithm/Flowchart
Algorithm:
Step 1: Select the language
Step 2: Input the text/speech that want to translate
Step 3: convert the speech into text
Step 4: language detection
Step 5: translate into given language
Step 6: convert speech into text
Step 7: output of translated language
Flowchart:
6
3.2.2 Data set
• Tkinter module as GUI interface
• Cttypes library
• PIL library (python imaging library)
• Tkinter.messagebox as tkMessageBox
• Speech recognition library
• pyttsx3 is a text-to-speech conversion library.
• Threading library
• From deep translator module import googletrans library
• Gtts module for text to audio
• pydub is a Python library work with audio files.
can =
Canvas(main,width=400,height=450,bg="#17C3B2",relief="solid",bd=1,highlig
htthickness=0) can.place(x=30,y=80)
7
Label(main,text="Input Box
:",font=("",12,"bold"),bg="#17C3B2",fg="black").place(x=44,y=70)
can =
Canvas(main,width=400,height=450,bg="#17C3B2",relief="solid",bd=1,highlig
htthickness=0) can.place(x=490,y=80)
Label(main,text="Output Box
:",font=("",12,"bold"),bg="#17C3B2",fg="black").place(x=780,y=60)
txtbx =
Text(main,width=40,height=7,font=("",12,"bold"),relief="solid",bd=0,highlightt hickness=0)
txtbx.place(x=50,y=100) txtbx2 =
Text(main,width=40,height=7,font=("",12,"bold"),relief="solid",bd=0,highlightt hickness=0)
txtbx2.place(x=510,y=100)
def translate():
global txtbx,txtbx2 txtbx2.delete("1.0","end-1c") tx = txtbx.get("1.0",END)
code = ["en","hi","ta","gu","mr"] lang = code[lt.index(v2.get())] translated =
GoogleTranslator(source='auto', target=lang).translate(tx) txtbx2.insert("end-
1c",translated) def detect():
global flag,txtbx
while(1):
if flag==True:
print("breaked")break
try: with sr.Microphone() as source2:
r.adjust_for_ambient_noise(source2, duration=0.2)
audio2 = r.listen(source2)
MyText = r.recognize_google(audio2) MyText =
MyText.lower()
txtbx.insert("end- 1c", MyText)
8
except sr.RequestError as e:
tkMessageBox.showinfo("warning","Could not request results; {0}".format(e))
break
except sr.UnknownValueError:
tkMessageBox.showinfo("warning","unknown error occured")
break def start(): global flag,b1 flag=False b1["text"]= "Stop Speaking"
b1["command"] = stop td.Thread(target=detect).start()
def stop():
global flag,b1 b1["text"] = "Give
Voice Input" b1["command"] =
start flag=True
b1 = Button(main,text="Give Voice
Input",font=("",12,"bold"),width=35,height=1,bg="#FEF9EF",fg="black",comm
and=start,relief="solid",bd=4,highlightthickness=0) b1.place(x=50,y=250)
Button(main,text="Speak
Text",font=("",12,"bold"),width=35,height=1,bg="#FEF9EF",fg="black",comma
nd=speak,relief="solid",bd=4,highlightthickness=0).place(x=510,y=250)
Button(main,text="Translate",font=("",15,"bold"),width=71,height=3,bg="#FE
F9EF",fg="black",command=translate,relief="solid",bd=3,highlightthickness=0
).place(x=30,y=446)
Label(main,text="Select Language
:",font=("",12,"bold"),bg="#17C3B2",fg="black").place(x=50,y=300)
Label(main,text="Select Language
:",font=("",12,"bold"),bg="#17C3B2",fg="black").place(x=510,y=300)
o1 = OptionMenu(main,v1,*lt)
o1.config(font=("",12,"bold"),width=36,bg="#FEF9EF",fg="black",relief="solid"
,bd=1,highlightthickness=0) o1.place(x=50,y=340) o2 = OptionMenu(main,v2,*lt)
o2.config(font=("",12,"bold"),width=36,bg="#FEF9EF",fg="black",relief="solid"
,bd=1,highlightthickness=0) o2.place(x=510,y=340)
main.mainloop()
9
Chapter 4. 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
MODULES:
USER MODULE
⚫ Text/speak: that he/she want to translate.
⚫ Language change: According to understanding they can change language of
the translation.
10
11
Chapter 5. 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.
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
12