0% found this document useful (0 votes)
44 views65 pages

Full Doc Major Project Groop

The document discusses developing a personal desktop assistant using Python. It aims to provide convenience, automation and assistance to users for computer activities. The assistant is customizable and extensible. The user interface is intuitive and user-friendly for both novice and experienced users.

Uploaded by

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

Full Doc Major Project Groop

The document discusses developing a personal desktop assistant using Python. It aims to provide convenience, automation and assistance to users for computer activities. The assistant is customizable and extensible. The user interface is intuitive and user-friendly for both novice and experienced users.

Uploaded by

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

A Major Project report

On

AI Powered Personal Assistant

A dissertation Submitted in partial fulfillment of the requirement


for the
Award of the degree of

BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATION ENGINEERING

By

MUTHOJU SRIYA 20N31A04F3


PENDYALA NIKHILANAND 20N31A04G6
PURALASETTY SAI KIRAN 20N31A04H5

Under the esteemed guidance of


Mrs.K.VIJAYA BHARATHI
(ASSISTANT PROFESSOR)

DEPARTMENT OF ELECTRONICS & COMMUICATION ENGINEERING


MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
Autonomous Institution – UGC, Govt. of India
(Affiliated to JNTU, Hyderabad, Approved by AICTE - Accredited by NBA & NAAC – ‘A’ Grade)
Maisammaguda, Dhulapally (Post Via Hakimpet), Secunderabad – 500100

i
2020-2024
CERTIFICATE

This is to certify that the MAJOR PROJECT work entitled “AI Powered Personal
Assistant” is carriedout by MUTHOJU SRIYA (20N31A04F3), PENDYALA NIKHILANAND
(20N31A04G6), PURALASETTY SAI KIRAN (20N31A04H5) in partial fulfillment for the
award of degree of BACHELOR OF TECHNOLOGY in Electronics and communication
Engineering, Jawaharlal Nehru Technological University , Hyderabad during the
academic year 2023-2024.

INTERNAL GUIDE HEAD OF THE DEPARTMENT

Mrs.K.VIJAYA BHARATHI Dr K MALLIKARJUNA LINGAM


(Assistant professor) PROFESSOR & HOD

EXTERNAL EXAMINER

i
DECLARATION

I hereby declare that the Major Project titled “AI Powered Personal Assistant” submitted
to Malla Reddy College of Engineering and Technology (UGC Autonomous), affiliated to
Jawaharlal Nehru Technological University Hyderabad (JNTUH) for the award of the
degree of Bachelor of Technology in, Electronics and Communication Engineering is a
result of original research carried-out in this thesis. It is further declared that the Major
Project report or any part thereof has not been previously submitted to any University or
Institute for the award of degree or diploma.

Muthoju Sriya - 20N31A04F3


Pendyala Nikhilanand - 20N31A04G6
Puralasetty Sai kiran - 20N31A04H5

i
ACKNOWLEDGEMENTS

I feel myself honored and privileged to place my warm salutation to my college Malla
Reddy College of Engineering and Technology (UGC-Autonomous) and to our Director
Dr. VSK Reddy and Principal Dr.S.Srinivasa Rao and Dr.T Venugopal Dean-students
Welfare who gave us the opportunity to have experience in engineering and profound
technical knowledge.

I express our heartiest thanks to Prof. P. Sanjeeva Reddy, Dean International Studies
and Dr. K. Mallikarjuna Lingam, Head of the Department of Electronics and
Communication Engineering for encouraging me in every aspect of my project and
helping me realize my full potential.

I would like to thank Dr.Sadand Yadav, MAJOR PROJECT Coordinator, for his valuable
guidance and encouragement during my dissertation work. I would like express my
sincere gratitude to the PRC Members Dr.Sadand Yadav, and Mrs.N.Saritha , for their
valuable suggestions in the Project Reviews.

I would like to thank our internal guide Mrs. K. Vijaya Bharathi (Assistant Professor) for
her regular guidance and constant encouragement.I are extremely grateful to her
valuable suggestions and unflinching co-operation throughout project work.

I would also like to thank all the supporting staff of the Department of ECE and all other
departments who have been helpful directly or indirectly in making my project a
success. I am extremely grateful to my parents for their blessings and prayers for the
completion of our project that gave us strength to do my project.

With Regards and Gratitude.

By
Muthoju Sriya - 20N31A04F3
Pendyala Nikhilanand - 20N31A04G6
Puralasetty Sai kiran - 20N31A04H5

i
CONTENTS

Title of the Chapter Page No


Cover Page i
Certificate ii
Declaration iii
Acknowledgements iv
Abstract 1
Chapter 1 – Introduction 2

1.1 Overview 2

1.2 Design 3

1.3 What is Voice Assistant 3

1.4 Why do we need it 3

1.5 Where to use it 4

Chapter 2 – Literature Review 5

2.1 Related work 5


Chapter 3 – Methodology 8

3.1 Existing System 8

3.2 Proposed System 9


3.3 Objective of project 10

3.4 Software 10

3.4.1 Software Requirements 10

3.5 Libraries 10

3.6 Programming Languages 11

3.6.1 Python 11

3.6.2 Domain 12

3.7 System Architecture 14

3.8 Algorithms used 16

3.8.1 Speech Recognition Model 16

3.8.2 Speech to Text & Text to Speech 16

3.8.3 Process & Executes The Required Command 17

Chapter 4 – Methodolgy 18

4.1 System Design 18

4.1.1 Use Case Diagram 18

4.1.2 Component Diagram 19


4.1.3 Sequence Diagram 20

4.2 Feasibility study 21

4.3 Types of Operation 22


4.4 Algorithm 23
Chapter 5 – Results Discussion 26
5.1 Working 26

Chapter 6 – Conclusions and Future Scope 28


6.1 Conclusion 28

6.2 Future Scope Of The Project 29

References 31

Appendix A: Source Code


Appendix B: Project Working Snap Shots

LIST OF FIGURES

FIGURE NUMBER TITLE OF THE FIGURE PAGE


NO.
Figure No.3.7 System Architecture 14
Figure No.3.7.1 Data Flow Diagram 15
Figure No.3.7.2 Processing in proposed system 15
Figure No.3.7.3 Execution 16
Figure No.4.1.1 Use Case Diagram 18
Figure No.4.1.2 Component Diagram 19
Figure No.4.1.3 Sequence Diagram 20
....
....
Working Snaps
ABSTRACT

AI-powered voice assistants have become an integral part of our lives, intertwining
technology and daily tasks. A Personal Virtual Assistant allows a user to command or ask
questions in the same manner that they would do with another human and are even
capable of doing some basic tasks like opening apps, doing Wikipedia searches without
opening a browser, playing music etc, with just a voice command. In the current days, a
voice assistant is everywhere which is a lot useful in these busy days. Nowadays, almost
everyone in the current world is using voice assistant because it’s everywhere starting
from Google smartphone assistant which even 5 years old kids will know how to use
because of the current world pandemic which makes them use smartphones till
Amazon's Alexa which will be very useful to do works starting from entertaining the
users till turning on and off the household products (Internet of Things). This project
presents the development of a personal desktop assistant using Python, aiming to
provide convenience, automation, and assistance to users in their computer-related
activities.The assistant differentiates itself from existing solutions by offering a highly
customizable and extensible platform.The user interface is designed to be intuitive and
user-friendly, providing a seamless experience for both novice and experienced users.
Key words: Automation, Integration, Functionality,Convenience.

Page 1
Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 1
INTRODUCTION

1.1 OVERVIEW
The very first voice activated product was released in 1922 as Radio Rex. This toy
was very simple, wherein a toy dog would stay inside a dog house until the user
exclaimed its name, “Rex” at which point it would jump out of the house. This was all
done by an electromagnet tuned to the frequency similar to the vowel found in the word
Rex, and predated modern computers by over 20 years.
In the 21st century, human interaction is being replaced by automation very quickly.
One of the main reasons for this change is performance. There’s a drastic change in
technology rather than advancement. In today’s world, we train our machines to do
their tasks by themselves or to think like humans using technologies like Machine
Learning, Neural Networks, etc. Now in the current era, we can talk to our machines
with the help of virtual assistants.
Nowadays almost all jobs are done digitally. We have Smartphones in our hands and
nothing less than having the world in our hands. These days we don't even use our
fingers. We are just talking about work and it is done. There are plans where we can say
to the Father of the Scriptures, "I'll be late today." Text is also sent. That is the work of
the Visible Assistant. It also supports specialized functions such as booking a flight, or
getting the cheapest book online from various e-commerce sites and provides an order
booking link, which facilitates automatic search, discovery, and online ordering services.
Wise assistants based on the word need a persuasive word or a wake-up call to make
the listener active, which is followed by a command. In my project the rising name is
MAX. We have many visible assistants, such as Apple's Siri, Amazon's Alexa, and
Microsoft's Cortana. In this project, the wake-up name is selected for MAX.
Virtual Assistants can provide several services including,
• The weather.
• Scheduling appointment time.
• Trip planning.
• Play music, movies, etc.
• Indicates the time of day.
• Manage emails.
• Open applications..

AI Powered Personal Assistant Page 2


Malla Reddy College of Engineering & Technology Department of ECE

1.2 DESIGN
a) The voice assistant takes an input word which is called as "signal word" to be
activated. so, it takes in the signal word and starts operating for the user
commands.
b) Converting the speech into text will be processed by the assistant.
c) The converted text is now processed to get the required results.
d) The text given by the user should contain one or two keywords that determine
what query is to be executed. If the keyword doesn’t match any of the queries
in the code then the assistant asks the user to speak again.
e) Finally, the output to the user's query will be given by converting speech to text.

1.3 WHAT IS VOICE ASSISTANT


A voice assistant, also known as an intelligent personal assistant or a connected
speaker, is a new type of device that is based on natural language speech recognition
and is offered by popular companies like Apple, Amazon, and Google. We got inspired
by that and created one our self

1.4 WHY DO WE NEED IT


Usually, typing out and searching or doing day-to-day tasks becomes hectic. But our
life doesn’t need to be like that. One can ask for help to voice assistants. They let the
users to perform a task using a speech command, as well as retrieve information via
voice synthesis.
Following are the reasons to have a voice assistant.
• Minimal Effort
➢ It’s easier to say a few words than type them on a small smartphone screen.
• Eyes Free
➢ One can be as blind as a bat, but a voice assistant will always help you. Our ears
are enough. One can also ask the bot about something while cooking at the same
time.
• Fast response
➢ Imagine how much time you have to spend to find some information on a
website? Or how many clicks do you need to make before you find the thing you
need in a mobile application? Voice assistants don’t generate such difficulties.
One can ask a question and you have the answer.

AI Powered Personal Assistant Page 3


Malla Reddy College of Engineering & Technology Department of ECE

1.5WHERE TO USE IT

Voice search has been a hot topic of discussion. Voice visibility will undoubtedly be a
challenge. This is due to the lack of a visual interface for voice assistants. Users cannot see or
interact with a voice interface unless it is linked to the Alexa or Google Assistant app. Search
behavior patterns will change dramatically as a result.
Brands are currently undergoing a transformation in which touchpoints are transforming
into listening points, and organic search will be the primary means of brand visibility.
Advertising agencies are becoming more popular as voice search grows in popularity. Voice
assistants will also continue to offer more individualized experiences as they get better at
differentiating between voices. The number of people using voice assistants is expected to
grow. According to the Voice bot Smart Speaker Consumer Adoption Report 2018, almost ten
percent of people who do not own a smart speaker plan to purchase one. If this holds true,
the user base of smart speaker users will grow 50 percent, meaning a quarter of adults in the
United States will own a smart speaker.

AI Powered Personal Assistant Page 4


Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 2
LITERATURE REVIEW

2.1 RELATED WORK


This field of virtual assistants having speech recognition has seen some major
advancements or innovations. This is mainly because of its demand in devices like
smartwatches or fitness bands, speakers, Bluetooth earphones, mobile phones, laptop
or desktop, television, etc. Almost all the digital devices which are coming nowadays
are coming with voice assistants which help to control the device with speech
recognition only. A new set of techniques is being developed constantly to improve
the performance of voice automated search.
As the amount of data is increasing exponentially now known as Big Data the best
way to improve the results of virtual assistants is to incorporate our assistants with
machine learning and train our devices according to their uses. Other major techniques
that are equally important are Artificial Intelligence, Internet of Things, Big Data access
and management, etc. With the use of voice assistants, we can automate the task
easily, just give the input to the machine in the speech form and all the tasks will be
done by it from converting your speech into text form to taking out keywords from
that text and execute the query to give results to the user.
Machine Learning is just a subset of Artificial Intelligence. This has been one of the
most helpful advancements in technology. Before AI we were the ones who were
upgrading technology to do a task but now the machine is itself able to counter new
tasks and solve it without need to involve the humans to evolve it.
This has been helpful in day-to-day lifestyle. From mobile phones to personal desktops
to mechanical industries these assistants are in very much demand for automating
tasks and increasing efficiency.

➢ Nivedita Singh (2021) et al. proposed a voice assistant using python speech to
text (STT) module and had performed some api calls and system calls which has
led to developing a voice assistant using python which allows the user to run
any type of command through voice without interaction of keyboard. This can
also run on hybrid platforms. Therefore, this paper lacks in some parts like the
system calls that aren’t much supported.

➢ Abeed Sayyed (2021) et al. presented a paper on Desktop Assistant AI using


python with IOT features and also used Artificial Intelligence (AI) features along

AI Powered Personal Assistant Page 5


Malla Reddy College of Engineering & Technology Department of ECE

with a SQLite DB with the use of Python. This Project has a Database connection
and a query framework but lacks API call and System calls features.

➢ P.Krishnaraj (2021) et al. presented a project on Portable Voice Recognition


with GUI Automation, This system uses Google’s online speech recognition
system for converting speech input to text along with Python. Therefore, this
project has a GUI and is also has a portable framework. Accuracy of this text to
speech (TTS) engine is comparatively less and also lacks IoT.

➢ Rajdip Paul (2021) et al. presented a project named A Novel Python-based


Voice Assistance System for reducing the Hardware Dependency of Modern
Age Physical Servers. This Author has proposed assistant project with python
as a backend supporting system calls, api calls and various features. This Project
is quite well responsive with api calls, also needs improvement in
understanding and reliability.

➢ V. Geetha (2021) et al. presented a project named The Voice Enabled Personal
Assistant for Pc using Python. This Author has proposed assistant project with
python as a backend and features like turning our PC off, or restarting it, or
reciting some latest news, are just one voice command away. Also, this project
has well supported library not every API will have the capability to convert the
raw JSON data into text. And there is a delay in processing request calls.

➢ Dilawar Shah Zwakman (2021) et al. proposed the Usability Evaluation of


Artificial Intelligence-Based Voice Assistants which can give proper response to
the user's request. It also has a feature where it can make an appointment with
the person mention by the user through voice but it lacks API calls.

➢ Dimitrios Buhalis (2021) et al. proposed a paper on In-room Voice-Based AI


Digital Assistants Transforming On-Site Hotel Services and Guests’ Experiences.
Where voice assistant is used for hotel services. It'll be very useful in this
current COVID-19 era. Human Touch is considered as a danger in this COVID
time and with a voice assistant, loss of human touch is not considered as an
advantage. It can also be used to control the temperature controls and room
light controls but it needs Complex Integration and Staff Training.

AI Powered Personal Assistant Page 6


Malla Reddy College of Engineering & Technology Department of ECE

➢ Philipp Sprengholz (2021) et al. has proposed Ok Google: Using virtual


assistants for data collection in psychological and behavioural research which
is a survey mate that they have developed which is an extension of the Google
Assistant that was used to check the reliability and validity of data collected by
this test. Possible answers and synonyms are defined for every different type
of questions so, it can be used to analyse the behaviour of an individual. As it
is a psychological and behavioural research assistant.

➢ Rahul Kumar (2020) et al. has proposed Power Efficient Smart Home with voice
assistant by which we can say that a Voice Assistant is one of the important
part of the Smart home which is becoming one of the major things in the
current world as it can operate the Home Appliances just with voice which also
increase the home security because of the smart locks but it requires a reliable
internet connection which is crucial and sometimes, the user might lock
themselves out of their own house.

➢ Benedict D. C (2020) et al. proposed Consumer decisions with artificially


intelligent voice assistants that will have stronger psychological reactions to the
system's look on human like behaviours. The assistant has an IoT (Internet of
Things) features. It can also order stuffs which the user want but there are
some cons in this paper. Voice assistant relies on the speaker’s ability to
represent the decision alternatives to catch up in voice dialogues and another
main disadvantage is that, it lacks system calls.

➢ Tae-Kook Kim (2020) el at. has proposed a Short Research on Voice Control
System Based on Artificial Intelligence Assistant which states AI assistant
system using open API artificial intelligence, and the conditional auto-run
system, IFTTT (IF This, Then That). It can control the system using the Raspberry
PI board but it lacks system calls.

AI Powered Personal Assistant Page 7


Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 3
METHODOLOGY

3.1 EXISTING SYSTEM


In recent years, the proliferation of AI personal assistants has transformed the way
individuals interact with technology. These assistants, powered by advanced
algorithms and machine learning models, aim to streamline tasks, provide assistance,
and enhance user productivity. Python, with its versatility and extensive libraries, has
emerged as a primary language for developing AI personal assistants. In this essay, we
will explore the functionality, advantages, and disadvantages of existing models of AI
personal assistants built using Python.
Functionality:
AI personal assistants encompass a wide range of functionalities, tailored to meet
diverse user needs. Some common functionalities include:
1. Natural Language Understanding (NLU): AI personal assistants are equipped with
NLU capabilities, enabling them to comprehend user queries in natural language. This
functionality involves tasks such as intent recognition, entity extraction, and syntactic
parsing, allowing assistants to interpret user requests accurately.
2. Task Automation: One of the primary functions of AI personal assistants is task
automation. These assistants can perform a variety of tasks on behalf of the user, such
as setting reminders, scheduling appointments, sending emails, and managing to-do
lists. By automating routine tasks, assistants help users save time and increase
efficiency.
3. Information Retrieval: AI personal assistants serve as repositories of knowledge,
capable of retrieving information from vast databases and online sources. Whether it's
answering factual questions, providing weather updates, or fetching the latest news,
assistants leverage their access to information to deliver timely and relevant
responses.
4. Personalization: Advanced AI personal assistants leverage machine learning
algorithms to personalize user experiences. By analyzing user interactions and
preferences, assistants can tailor recommendations, anticipate user needs, and adapt
their behavior over time, thereby enhancing user satisfaction and engagement.
5. Multimodal Interaction: With advancements in speech recognition and computer
vision technologies, AI personal assistants now support multimodal interaction. Users
can interact with assistants through voice commands, text input, or even gestures and
images, expanding the range of applications and use cases.

AI Powered Personal Assistant Page 8


Malla Reddy College of Engineering & Technology Department of ECE

3.2 PROPOSED SYSTEM


We are proposing a system in an efficient way of implementing a Personal voice
assistant, Speech Recognition library has many in-built functions, that will let the assistant
understand the command given by user and the response will be sent back to user in
voice, with Text to Speech functions. When assistant captures the voice command given
by user, the under lying algorithms will convert the voice into text. And according to the
keywords present in the text (command given by user), respective action will be
performed by the assistant.
This is made possible with the functions present in different libraries. Also, the
assistant was able to achieve all the functionalities with help of some API’s. We had used
these APIs for functionalities like performing calculations, extracting news from web
sources, and for telling the weather. We will be sending a request, and through the API,
we’re getting the respective output.
API’s like WOLFRAMALPHA, are very helpful in performing things like calculations,
making small web searches. And for getting the data from web. In this way, we are able
to extract news from the web sources, and send them as input to a function for further
purposes. Also, we have libraries like Random and many other libraries, each
corresponding to a different technology.
We used the library OS to implement Operating System related functionalities like
Shutting down a system, or restarting a system.
At the outset we make our program capable of using system voice with the help of sapi5
and pyttsx3. pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative
libraries, it works offline, and is compatible with both Python 2 and 3. The Speech
Application Programming Interface or SAPI is an API developed by Microsoft to allow the
use of speech recognition and speech synthesis within Windows applications.

Then we define the speak function to enable the program to speak the outputs. After that
we will define a function to take voice commands using the system microphone. The main
function is then defined where all the capabilities of the program are defined.

• The proposed system will have the following functionality:


(a) The system will keep listening for commands and the time for listening is variable
which can be changed according to user requirements.
(b) If the system is not able to gather information from the user input it will keep asking
again to repeat till the desired number of times.
(c) The system can have both male and female voices according to user requirements.

AI Powered Personal Assistant Page 9


Malla Reddy College of Engineering & Technology Department of ECE

(d) Features supported in the current version include playing music, texts, search on
Wikipedia, or opening system installed applications, opening anything on the web
browser, etc.

3.3 OBJECTIVE OF PROJECT


Main objective of building personal assistant software (a virtual assistant) is using
semantic data sources available on the web, user generated content and providing
knowledge from knowledge databases. The main purpose of an intelligent virtual assistant
is to answer questions that users may have. This may be done in a business environment,
for example, on the business website, with a chat interface. On the mobile platform, the
intelligent virtual assistant is available as a call-button operated service where a voice asks
the user “What can I do for you?” and then responds to verbal input. Virtual assistants
can tremendously save you time. We spend hours in online research and then making the
report in our terms of understanding. 10 Provide a topic for research and continue with
your tasks while the assistant does the research. Another difficult task is to remember test
dates, birthdates or anniversaries. It comes with a surprise when you enter the class and
realize it is class test today. Just tell assistant in advance about your tests and she reminds
you well in advance so you can prepare for the test. One of the main advantages of voice
searches is their rapidity. In fact, voice is reputed to be four times faster than a written
search: whereas we can write about 40 words per minute, we are capable of speaking
around 150 during the same period of time. In this respect, the ability of personal
assistants to accurately recognize spoken words is a prerequisite for them to be adopted
by consumers.
3.4 SOFTWARE
3.4.1 SOFTWARE REQUIREMENTS:
✓ Python 3.5 & Above
✓ Windows 7 And Above

3.5 LIBRARIES

➢ Serial- This module encapsulates the access for the serial port. It provides
backends for Python running on Windows, OSX, Linux, BSD and Iron Python. The
module named “serial” automatically selects the appropriate backend. Command
to install :- pip install pyserial

AI Powered Personal Assistant Page 10


Malla Reddy College of Engineering & Technology Department of ECE

➢ Time- This module provides many ways of representing time in code, such as
objects, numbers, and strings. It also provides functionality other than
representing time, like waiting during code execution and measuring the
efficiency of our code. This is a built-in module so the installation is not necessary.
➢ Wikipedia :-This is a Python library that makes it easy to access and parse data
from Wikipedia. Search Wikipedia, get article summaries, get data like links and
images from a page, and more. Wikipedia is a multilingual online encyclopedia.
Command to install :- pip install Wikipedia.
➢ Pyttsx3- It is a text to speech conversion library in python which is used to convert
the text given in the parenthesis to speech. It is compatible with python 2 and 3.
An application invokes the pyttsx3.init() factory function to get a reference to a
pyttsx3. it is a very easy to use tool which converts the entered text into speech.
The pyttsx3 module supports two voices first is female and the second is male
which is provided by “sapi5” for windows. Command to install: - pip install pyttsx3
It supports three TTS engines: - sapi5- To run on windows nsss -
NSSpeechSynthesizer on Mac OS X espeak – eSpeak on every other platform
➢ Speech_recognition- It allows computers to understand human language. Speech
recognition is a machine's ability to listen to spoken words and identify them. We
can then use speech recognition in Python to convert the spoken words into text,
make a query or give a reply. Python supports many speech recognition engines
and APIs, including Google Speech Engine, Google Cloud Speech API.
Command to install :- pip install SpeechRecognition
➢ WolfarmAlpha- Wolfram Alpha is an API which can compute expert-level answers
using Wolfram's algorithms, knowledgebase and AI technology. It is made
possible by the Wolfram Language. The WolfarmAlpha API provide a web-based
API allowing the computational and presentation capabilities of WolframAlpha to
be integrated into web, mobile and desktop applications.
Command to install :- pip install wolframalpha
➢ Randfacts- Randfacts is a python library that generates random facts. We can use
randfacts.get_fact() to return a random fun fact.
Command to install :- pip install randfacts
➢ Pyjokes- Pyjokes is a python library that is used to create one-line jokes for the
users. Informally, it can also be referred as a fun python library which is pretty
simple to use. Command to install :- pip install pyjokes
➢ Datetime- This module is used to get the date and time for the user. This is a built-
in module so there is no need to install this module externally. Python Datetime
module supplies classes to work with date and time. Date and datetime are an

AI Powered Personal Assistant Page 11


Malla Reddy College of Engineering & Technology Department of ECE

object in Python, so when we manipulate them, we are actually manipulating


objects and not string or timestamps.
➢ Random2- Python version 2 has a module named "random". This module provides
a Python 3 ported version of Python 2.7's random module. It has also been back-
ported to work in Python 2.6. In Python 3, the implementation of randrange() was
changed, so that even with the same seed you get different sequences in Python
2 and 3.
➢ Math- This is a built-in module which is used to perform mathematical tasks. For
example, math.cos() which returns the cosine of a number or math.log() returns
the natural logarithm of a number, or the logarithm of number to base.
➢ Warnings- The warning module is actually a subclass of Exception which is a built-
in class in Python. A warning in a program is distinct from an error. Conversely, a
warning is not critical. It shows some message, but the program runs.
➢ OS- The os module is a built-in module which provides functions with which the
user can interact with the os when they are running the program. This module
provides a portable way of using operating system-dependent functionality. This
module has functions with which the user can open the file which is mentioned in
the program.

3.6 PROGRAMMING LANGUAGES


3.6.1 PYTHON
Python is an OOPs (Object Oriented Programming) based, high level, interpreted
programming language. It is a robust, highly useful language focused on rapid application
development (RAD). Python helps in easy writing and execution of codes. Python can
implement the same logic with as much as 1/5th code as compared to other OOPs
languages. Python provides a huge list of benefits to all. The usage of Python is such that
it cannot be limited to only one activity. Its growing popularity has allowed it to enter into
some of the most popular and complex processes like Artificial Intelligence (AI), Machine
Learning (ML), natural language processing, data science etc. Python has a lot of libraries
for every need of this project. For this project, libraries used are speech recognition to
recognize voice, Pyttsx for text to speech, selenium for web automation etc.
It’s owing to the subsequent strengths that Python has –
➢ Easy to be told and perceive- The syntax of Python is simpler; thence it's
comparatively straightforward, even for beginners conjointly, to be told and
perceive the language.

AI Powered Personal Assistant Page 12


Malla Reddy College of Engineering & Technology Department of ECE

➢ Multi-purpose language − Python could be a multi-purpose programing language


as a result of it supports structured programming, object-oriented programming
yet as practical programming.
➢ Support of open supply community − As being open supply programing language,
Python is supported by awfully giant developer community. Because of this, the
bugs square measure simply mounted by the Python community. This
characteristic makes Python terribly strong and adaptative.

3.6.2 DOMAIN
• The internet of things, or IoT, is a system of interrelated computing devices,
mechanical and digital machines, objects, animals or people that are provided with
unique identifiers (UIDs) and the ability to transfer data over a network without
requiring human-to-human or human-to-computer interaction.
• A thing in the internet of things can be a person with a heart monitor implant, a
farm animal with a biochip transponder, an automobile that has builtin sensors to
alert the driver when tire pressure is low or any other natural or man-made object
that can be assigned an Internet Protocol (IP) address and is able to transfer data
over a network.
• Increasingly, organizations in a variety of industries are using IoT to operate more
efficiently, better understand customers to deliver enhanced customer service,
improve decision-making and increase the value of the business.
• An IoT ecosystem consists of web-enabled smart devices that use embedded
systems, such as processors, sensors and communication hardware, to collect,
send and act on data they acquire from their environments.
• IoT devices share the sensor data they collect by connecting to an IoT gateway or
other edge device where data is either sent to the cloud to be analysed or analysed
locally. Sometimes, these devices communicate with other related devices and act
on the information they get from one another. The devices do most of the work
without human intervention, although people can interact with the devices -- for
instance, to set them up, give them instructions or access the data.

AI Powered Personal Assistant Page 13


Malla Reddy College of Engineering & Technology Department of ECE

3.7 SYSTEM ARCHITECTURE

Fig 3.7 System Architecture

AI Powered Personal Assistant Page 14


Malla Reddy College of Engineering & Technology Department of ECE

Fig 3.7.1 Data Flow Diagram

Fig 3.7.2 Processing in proposed system

AI Powered Personal Assistant Page 15


Malla Reddy College of Engineering & Technology Department of ECE

Fig 3.7.3 Execution

3.8 ALGORITHMS USED


3.8.1 SPEECH RECOGNITION MODULE
➢ The class which we are using is called Recognizer.
➢ It converts the audio files into text and module is used to give the output in speech.
➢ Energy threshold function represents the energy level threshold for sounds.
Values below this threshold are considered silence, and values above this
threshold are considered speech.
➢ Recognizer instance.adjust_for_ambient_noise(source, duration = 1), adjusts the
energy threshold dynamically using audio from source (an AudioSource instance)
to account for ambient noise.
3.8.2 SPEECH TO TEXT & TEXT TO SPEECH CONVERSION
➢ Pyttsx3 is a text-to-speech conversion library in Python. And can change the Voice,
Rate and Volume by specific commands.
➢ Python provides an API called Speech Recognition to allow us to convert audio into
text for further processing converting large or long audio files into text using the
Speech Recognition API in python.
➢ We have Included sapi5 and espeak TTS Engines which can process the same.

AI Powered Personal Assistant Page 16


Malla Reddy College of Engineering & Technology Department of ECE

3.8.3 PROCESS & EXECUTES THE REQUIRED COMMAND


➢ The said command is converted into text via speech recognition module and
further stored in a temp.
➢ Then, Analyze the user’s text via temp and decide what the user needs based on
input provided and runs the while loop.
➢ Then, Commands are executed.

AI Powered Personal Assistant Page 17


Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 4
METHODOLGY

4.1 SYSTEM DESIGN


4.1.1 USE CASE DIAGRAM:

Fig 4.1.1 Use Case Diagram

✓ In this project there is only one user. The user queries command to the system.
System then interprets it and fetches answer. The response is sent back to the
user.

AI Powered Personal Assistant Page 18


Malla Reddy College of Engineering & Technology Department of ECE

4.1.2 COMPONENT DIAGRAM:

Fig 4.1.2 COMPONENT DIAGRAM

✓ The main component here is the Virtual Assistant. It provides two specific
service, executing Task or Answering your question.

AI Powered Personal Assistant Page 19


Malla Reddy College of Engineering & Technology Department of ECE

4.1.3 SEQUENCE DIAGRAM:

Fig 4.1.3 SEQUENCE DIAGRAM

✓ The user sends command to virtual assistant in audio form. The command is
passed to the interpreter. It identifies what the user has asked and directs it to
task executer. If the task is missing some info, the virtual assistant asks user back
about it. The received information is sent back to task and it is accomplished.
After execution feedback is sent back to user.

AI Powered Personal Assistant Page 20


Malla Reddy College of Engineering & Technology Department of ECE

4.1.3 SEQUENCE DIAGRAM (Answering the user):

Fig 4.1.3. Sequence Diagram (Answering the user)

✓ The above sequence diagram shows how an answer asked by the user is being
fetched from internet. The audio query is interpreted and sent to Web scraper.
The web scraper searches and finds the answer. It is then sent back to speaker,
where it speaks the answer to user

4.2 FEASIBILITY STUDY


Feasibility study can help you determine whether or not you should proceed with
your project. It is essential to evaluate cost and benefit. It is essential to evaluate cost
and benefit of the proposed system. Five types of feasibility study are taken into
consideration.

1. Technical feasibility: It includes finding out technologies for the project, both
hardware and software. For virtual assistant, user must have microphone to convey
their message and a speaker to listen when system speaks. These are very cheap now
a days and everyone generally possess them. Besides, system needs internet
connection. While using, make sure you have a steady internet connection.

AI Powered Personal Assistant Page 21


Malla Reddy College of Engineering & Technology Department of ECE

2. Operational feasibility: It is the ease and simplicity of operation of proposed


system. System does not require any special skill set for users to operate it. In fact, it
is designed to be used by almost everyone. Kids who still don’t know to write can read
out problems for system and get answers.

3. Economic feasibility: Here, we find the total cost and benefit of the proposed
system over current system. For this project, the main cost is documentation cost.
User also, would have to pay for microphone and speakers. Again, they are cheap and
available. As far as maintenance is concerned, it won’t cost too much.

4. Organizational feasibility: This shows the management and organizational


structure of the project. This project is not built by a team. The management tasks are
all to be carried out by a single person. That won’t create any management issues and
will increase the feasibility of the project.

5. Cultural feasibility: It deals with compatibility of the project with cultural


environment. Virtual assistant is built in accordance with the general culture. This
project is technically feasible with no external hardware requirements. Also, it is
simple in operation and does not cost training or repairs. Overall feasibility study of
the project reveals that the goals of the proposed system are achievable. Decision is
taken to proceed with the project.

4.3 TYPES OF OPERATION


• Information:
If we ask for some information, it opens up wikipedia and asks us the topic on which
we want the information, then it clicks on the wikipedia search box using its xpath,
searches the topic in the search box and clicks the search button using the xpath of
the button and reads a paragraph about that topic.
Keyword: information
• Plays the video which we ask:
If we ask it to play a video, it opens up YouTube and asks us the name of the video
which it wants to play. After that, it clicks on the search YouTube search box using its
xpath, then it clicks on the search button using its xpath and clicks the first result of
the search using the xpath of the first video.
Keyword: Play and video or music

AI Powered Personal Assistant Page 22


Malla Reddy College of Engineering & Technology Department of ECE

• Open:
The assistant will open some of the folders and applications which the user asks the
assistant to open.
Keyword: Open
• Date and Time:
If the user asks for the date or time, the assistant tells it.
Keyword: date or time or date and time
• Calculate:
The assistant will calculate the equations which the user tells it to calculate using
wolframalpha API key.
Keyword : calculate (along with the equation).

4.4 ALGORITHM
Speech Recognition module:
In the realm of personal assistants powered by Python, the Speech Recognition
module emerges as a cornerstone technology, enabling seamless communication between
users and their digital companions through the medium of spoken language. At its core, the
Speech Recognition module serves as the auditory gateway through which users convey their
commands, queries, and requests to the personal assistant, transforming spoken words into
actionable data that the system can comprehend and execute upon.
The Speech Recognition module operates on a sophisticated blend of algorithms and
machine learning models meticulously trained on diverse datasets to decipher the intricacies
of human speech. By harnessing techniques such as acoustic modeling, language modeling,
and pattern recognition, this module endeavors to discern the phonetic nuances, linguistic
structures, and contextual cues embedded within spoken utterances, thereby enabling
accurate and reliable transcription of speech into text.
Moreover, the Speech Recognition module offers remarkable versatility and
adaptability, capable of accommodating diverse accents, dialects, and languages with
remarkable proficiency. Through continual refinement and optimization, it endeavors to
enhance its accuracy and robustness across various linguistic landscapes, ensuring inclusivity
and accessibility in user interactions.
In the context of a personal assistant powered by Python, the Speech Recognition
module serves as the foundational element that bridges the gap between human users and
the digital realm. Whether it be issuing voice commands to retrieve information, dictate
messages, or perform tasks, users rely on the Speech Recognition module to accurately
capture their spoken input and translate it into actionable commands that the personal
assistant can comprehend and act upon.

AI Powered Personal Assistant Page 23


Malla Reddy College of Engineering & Technology Department of ECE

SPEECH TO TEXT (STT) AND TEXT TO SPEECH (TTS):


Within the domain of personal assistants driven by Python, the symbiotic relationship
between Speech to Text (STT) and Text to Speech (TTS) conversion emerges as a cornerstone
feature, empowering users to interact with their digital companions through the medium of
spoken language.
Speech to Text (STT) Conversion:
Speech to Text (STT) conversion serves as the conduit through which the personal
assistant transcribes spoken input from users into textual form, enabling the system to
comprehend and process their commands, queries, and requests. By leveraging advanced
algorithms and machine learning models, STT conversion algorithms strive to decode the
acoustic signals captured by microphones, discerning the phonetic patterns, linguistic
structures, and contextual cues inherent in human speech. Through this process, spoken
utterances are transformed into textual data that the personal assistant can analyze,
interpret, and act upon.
Text to Speech (TTS) Conversion:
Conversely, Text to Speech (TTS) conversion empowers the personal assistant to
articulate textual content in a manner akin to natural speech, enabling seamless
communication between the system and the user. Leveraging synthesis techniques, linguistic
models, and voice generation algorithms, TTS systems endeavor to imbue synthesized speech
with fluency, intonation, and naturalness, thereby fostering engaging and lifelike interactions.
By emulating the nuances of human speech, including prosody, emphasis, and emotional
inflection, TTS conversion enables the personal assistant to convey information, respond to
queries, and engage in dialogue with users in a manner that resonates with human
communication patterns.
The Intersection of STT and TTS for Personal Assistants:
In the context of a personal assistant driven by Python, the seamless integration of Speech to
Text and Text to Speech conversion technologies enables a fluid and intuitive user experience,
wherein users can interact with their digital companions through natural spoken language.
Whether it be issuing voice commands, receiving spoken responses, or engaging in
conversational dialogue, users rely on the symbiotic interplay between STT and TTS
conversion to facilitate seamless communication and interaction with their personal
assistant.

PROCESS & EXECUTES THE REQUIRED COMMAND:


In the ecosystem of personal assistants built using Python, the ability to process and
execute user commands stands as a critical functionality, enabling the system to comprehend
user intent and respond accordingly with relevant actions or information.

AI Powered Personal Assistant Page 24


Malla Reddy College of Engineering & Technology Department of ECE

The process of executing user commands within a personal assistant system involves several
key steps:

Command Parsing and Interpretation: Upon receiving user input in textual form, the personal
assistant parses and interprets the command to discern the user's intent and identify the
relevant action to be taken.

Action Execution: Once the user's intent has been determined, the personal assistant
proceeds to execute the corresponding action or sequence of actions required to fulfill the
user's request. This may involve accessing relevant data sources, performing computations,
interfacing with external APIs or services, or invoking system functionalities to carry out the
desired task.

Feedback and Response Generation: Following the execution of the command, the personal
assistant generates a suitable response to provide feedback to the user. This response may
take the form of spoken output (utilizing Text to Speech conversion) or textual output
displayed on a user interface, conveying the results of the command execution or requesting
further input from the user if necessary.

Error Handling and Resilience: In the event of errors or unforeseen issues encountered during
command execution, the personal assistant employs robust error handling mechanisms to
gracefully handle such situations. This may involve providing informative error messages to
the user, offering alternative suggestions or pathways to achieve their goals, or escalating the
issue to a human operator for further assistance if needed.

User Interaction and Dialogue Management: Throughout the process of executing user
commands, the personal assistant engages in a dynamic dialogue with the user, soliciting
additional input, clarifying requests, and maintaining context across multiple interactions.
This dialogue management aspect ensures a fluid and coherent user experience, fostering
effective communication and collaboration between the user and the personal assistant.
In essence, the process of executing user commands within a personal assistant system
encompasses a multifaceted interplay of linguistic understanding, computational processing,
and interactive dialogue, culminating in seamless and intuitive interactions between users
and their digital companions. As personal assistant technologies continue to evolve and
mature, the refinement of these processes holds the promise of unlocking new frontiers in
human-computer interaction, enriching the lives of users and empowering them to achieve
their goals with greater ease and efficiency.

AI Powered Personal Assistant Page 25


Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 5
RESULTS DISCUSSION
The project work of the voice assistant has been clearly explained in this report, how
useful it is and how we can rely on a voice assistant for performing any/every task which
the user needs to complete and how the assistant is developing everyday which we can
hope that it'll be one of the biggest technology in the current technological world.
Development of the software is almost completed form our side and it's working fine as
expected which was discussed for some extra development. So, maybe some
advancement might come in the near future where the assistant which we developed
will be even more useful than it is now.
5.1. WORKING
It starts with a signal word. Users say the names of their voice assistants for the
same reason. They might say, “Hey Siri!” or simply, “Alexa!” Whatever the signal word
is, it wakes up the device. It signals to the voice assistant that it should begin paying
attention. After the voice assistant hears its signal word, it starts to listen. The device
waits for a pause to know you’ve finished your request.
The voice assistant then sends our request over to its source code. Once in the source
code, our request is compared to other requests. It’s split into separate commands that
our voice assistant can understand. The source code then sends these commands back
to the voice assistant. Once it receives the commands, the voice assistant knows what
to do next. If it understands, the voice assistant will carry out the task we asked for. For
example, “Hey NOVA! What’s the weather?” NOVA reports back to us in seconds.
The more directions the devices receive, the better and faster they get at fulfilling
our requests. The user gives the voice input through microphone and the assistant is
triggered by the wake up word and performs the STT (Speech to Text) and converts it
into a text and understands the Voice input and further performs the task said by the
user repeatedly and delivers it via TTS (Text to Speech) module via AI Voice.
These are the important features of the voice assistant but other than this, we can do
an plenty of things with the assistant.
List of features that can be done with the assistant:
✓ Playing some video which, the user wants to see.
✓ Telling some random fact at the start of the day with which the user can do their
work in an informative way and the user will also learn something new.
✓ One of the features which will be there in every assistant is playing some game
so that the user can spend their free time in a fun way.

AI Powered Personal Assistant Page 26


Malla Reddy College of Engineering & Technology Department of ECE

Opening the file/folder which the user wants:

✓ In the busy world, everything should do quick else, our schedule will get
changed and sometimes we need assistance of someone to complete that task
quickly but, if we have a voice assistant, we can complete that task in right away
in a hustle freeway. For example, let's say the user is doing some
documentation but after a while, he needs some file for reference and he goes
searching for that file which wastes a lot of time and he ends up missing the
deadline but, with a voice assistant we can do the searching part in a quick way
by commanding the assistant to open the folder. So, by this we can say that it
is one of the important features of a voice assistant.

Must provide the user any information which they ask for: -

✓ The user might need any information which will be available on the internet
but searching for that information and reading that takes a lot of time but with
the help of a voice assistant, we can complete that task of getting the
information sooner than searching and reading it. So, this is a small proof that
a voice assistant helps the user to save time

AI Powered Personal Assistant Page 27


Malla Reddy College of Engineering & Technology Department of ECE

CHAPTER 6
CONCLUSIONS & FUTURE SCOPE
6.1. CONCLUSION
As stated before, "voice assistant is one of the biggest problem solver" and you
can see that in the proposals with the examples that it is in fact one of the biggest
problem solver of the current world. We can see that voice assistant is one of the major
evolving artificial intelligence in the current world once again on seeing the proposal
examples because at the past, the best feature which a voice assistant had was telling
the date and searching the web and giving the results but now look at the functions
that it can do so with this, we can say that it is a evolving software in the current world.

• The main idea is to develop the assistant even more advanced than it is now
and make it the best ai in the world which will save an ample of time for its
users. I would like to conclude with the statement that we will try our best and
give one of the best voice assistants which we are able to.

• Virtual Personal Assistants are a very effective way to organize your program.
There are now many Smart Personal Digital Assistant apps available on the
market for various device platforms. These new Software apps work much
better than PDA devices as they provide all the features of your smartphone.
VPAs are also more reliable than Personal Assistants because VPAs are
portable and you can use them at any time. And they have more information
than any assistant as they are connected to the internet.

• The importance of AI in education cannot be overstated. While technology


provides multiple benefits and assists in a variety of academic and
administrative chores, it also raises concerns about the loss of decisionmaking
abilities, laziness, and security problems. AI technology aids decision-making
assists teachers and students in completing tasks and streamlines various
activities. However, these difficulties are being exacerbated by the increased
acceptance and dependence on AI in the education sector.

• This study's findings show that using AI in education accelerates the


deterioration of human decision-making abilities, encourages user sloth
through task automation, and contributes to greater security and privacy
problems. Addressing these problems and striking a balance between utilizing
the potential of AI in education while mitigating its potential drawbacks.

AI Powered Personal Assistant Page 28


Malla Reddy College of Engineering & Technology Department of ECE

6.2. FUTURE SCOPE OF THE PROJECT


We are entering the era of implementing voice-activated technologies to remain
relevant and competitive. Voice-activation technology is vital not only for businesses to
stay relevant with their target customers, but also for internal operations. Technology
may be utilized to automate human operations, saving time for everyone. Routine
operations, such as sending basic emails or scheduling appointments, can be completed
more quickly, with less effort, and without the use of a computer, just by employing a
simple voice command. People can multitask as a result, enhancing their productivity.
Furthermore, relieving employees from hours of tedious administrative tasks allows them
to devote more time to strategy meetings, brainstorming sessions, and other jobs that
need creativity and human interaction.
The goal of our project is to create a voice assistant that can help users efficiently
perform various tasks on their personal computers. The assistant will operate through voice
commands, minimizing the need for physical hardware. It will be able to open applications
and websites, play media, tell the time and date, and even greet users based on the current
time. We are also working on integrating AI technology to make the assistant more
interactive and engaging for users. With a wide range of possible tasks that can be
programmed, the potential uses for the assistant are virtually limitless. As we continue to
develop and improve the system, we hope to make it a valuable tool for users to streamline
their computer use and maximize productivity.

1) Sending Emails with a voice assistant:


Emails, as we all know, are very crucial for communication because they
can be used for any professional contact, and the finest service for sending and
receiving emails is, as we all know, GMAIL. Gmail is a Google-created free email
service. Gmail can be accessed over the web or using third-party apps that use the
POP or IMAP protocols to synchronize email content. To integrate Gmail with
Voice Assistant we have to utilize Gmail API. The Gmail API allows you to access
and control threads, messages, and labels in your Gmail mailbox.
2) Scheduling appointments using a voice assistant:
The demands on our time increase as our company grows. A growing
number of people want to meet with us. We have a growing number of people
who rely on us. We must check in on certain projects or set aside time to chat with
possible business leads. There won't be enough hours in the day if we keep doing
things the old way. We need to get a better handle on our full-time schedule and
devise a strategy for arranging appointments that doesn't interfere with our most
critical job. By working with a virtual scheduler or, in other words, a virtual

AI Powered Personal Assistant Page 29


Malla Reddy College of Engineering & Technology Department of ECE

assistant, we let someone else worry about the organization and prioritize our
schedule while we focus on the work.
3) Improved Interface of a voice assistant (VUI):
Voice user interfaces (VUIs) allow users to interact with a system by
speaking commands. VUIs include virtual assistants like Amazon's Alexa and
Apple's Siri. The real advantage of a VUI is that it allows users to interact with a
product without using their hands or their eyes while focusing on anything else.

-Other benefits of a Voice user interface (VUI):


Speed and Efficiency:
Hands-free interactions are possible with VUIs. This method of interaction
eliminates the need to click buttons or tap on the screen. The major means of
human communication is speech. People have been using speech to form
relationships for ages. As a result, solutions that allow customers to do the same
are extremely valuable. Furthermore, even for experienced texters, dictating text
messages has been demonstrated to be faster than typing. Hands-free
interactions, at least in some circumstances, save time and boost efficiency.
Intuitiveness and convenience:
Intuitive user flow is required of high-quality VUIs, and technical
advancements are expected to continue to improve the intuitiveness of voice
interfaces. Compared to graphical UIs, VUIs require less cognitive effort from the
user. Furthermore, everyone – from a small child to your grandmother – can
communicate. As a result, VUI designers are in a better position than GUI
designers, who run the danger of producing incomprehensible menus and
exposing users to the agony of poor interface design. Customers are unlikely to
need to be instructed on how to utilize the technology by VUI makers. People can
instead ask their voice assistant for assistance.

AI Powered Personal Assistant Page 30


Malla Reddy College of Engineering & Technology Department of ECE

REFERENCES

[1] K. Noda, H. Arie, Y. Suga, T. Ogata, Multimodal integration learning of robot behavior
using deep neural networks, Elsevier: Robotics and Autonomous Systems, 2014.
[2] Artificial intelligence (AI), sometimes called machine intelligence.
https://en.wikipedia.org/wiki/Artificial_intelligence.
[3] Deepak Shende, RiaUmahiya, Monika Raghorte, AishwaryaBhisikar, AnupBhange, “AI
Based Voice Assistant Using Python”, Journal of Emerging Technologies and Innovative
Research (JETIR), February 2019, Volume 6, Issue 2.
[4] J. B. Allen, “From lord rayleigh to shannon: How do humans decode speech,” in
International Conference on Acoustics, Speech and Signal Processing, 2002.
[5] John Levis and Ruslan Suvorov, “Automatic Speech Recognition”.
[6] B.H. Juang and Lawrence R. Rabiner, “Automatic Speech Recognition - A Brief History
of the Technology Development”.
[7] AbhayDekate, ChaitanyaKulkarni, RohanKilledar, “Study of Voice Controlled Personal
Assistant Device”, International Journal of Computer Trends and Technology (IJCTT) –
Volume 42 Number 1 – December 2016.

AI Powered Personal Assistant Page 31


Malla Reddy College of Engineering & Technology Department of ECE

APPENDIX-A

SOURCE CODE

def there_exists(terms):
for term in terms:
if term in voice_data:
return True

r = sr.Recognizer() # initialise a recogniser


# listen for audio and convert it to text:
def record_audio(ask=False):

with sr.Microphone() as source: # microphone as source


r.energy_threshold=500 #voice level number increse more sensitive
r.adjust_for_ambient_noise(source,1.2)# noise cancel rate
r.pause_threshold= 1
if ask:
speak(ask)
audio = r.listen(source) # listen for the audio via source
voice_data = ''

try :
voice_data = r.recognize_google(audio) # convert audio to text

except sr.RequestError:
speak('Sorry, the service is down') # error: recognizer is not connected
except sr.UnknownValueError: # error: recognizer does not understand
print('Recognizing..')
print(f">> {voice_data.lower()}") # print what user said
return voice_data.lower()

AI Powered Personal Assistant Page 32


Malla Reddy College of Engineering & Technology Department of ECE

# get string and make a audio file to be played


def speak(audio_string):
tts = gTTS(text=audio_string, lang='en-in') # text to speech(voice)
r = random.randint(1,20000000)
audio_file = 'audio-' + str(r) + '.mp3'
tts.save(audio_file) # save as mp3
playsound.playsound(audio_file) # play the audio file
print(audio_string) # print what app said
os.remove(audio_file) # remove audio file

def respond(voice_data):

# 1: greeting
if there_exists(["hey","hi","hello","wake up","hai"]):
greetings = ["hey", "hey, what's up? ", " how can I help you","I'm listening","hello"]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)

# 2: name
if there_exists(["your name","what i call you","what is your good name"]):
name= record_audio("my name is Vavo stand for virtual assistance version One. what's
your name?")
speak('Nice to meet you '+ name )
speak('how can i help you ' + name)

# 3: Origin
if there_exists(["who are you","your inventor","invented you","created you","who is your
developer"]):
greetings = ["I am Virtual Voice Assistant","I am developed by mr.abhijeet as a voice
assistance"] # You can Add your name
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)

AI Powered Personal Assistant Page 33


Malla Reddy College of Engineering & Technology Department of ECE

if there_exists(["what is your age","how old are you","when is your birthday"]):


greetings = ["I came into this world in march 2021"]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)
# 3: Take care's
if there_exists(["how's everything" ,"how ia everything","how are you","how are you
doing","what's up","whatsup"]):
greetings = ["I am well ...thanks for asking ","i am well" ,"Doing Great" ]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)
# 3: greeting
if there_exists(["What are you doing" ,"what you doing","doing"]):
greetings = ["nothing", "nothing...,just working for you","Nothing much"]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet
# 4.1: time
if there_exists(["what's the time","tell me the time","what time is it","what is the
time","time is going on"]):
time = ctime().split(" ")[3].split(":")[0:2]
if time[0] == "00":
hours = '12'
else:
hours = time[0]
minutes = time[1]
time = f'{hours} {minutes}'
speak(time)
# 5: search wekiapedia
if there_exists(["wikipedia"]):
search = record_audio('What do you want to search for?')
url = 'https://en.wikipedia.org/wiki/'+ search
webbrowser.get().open(url)

AI Powered Personal Assistant Page 34


Malla Reddy College of Engineering & Technology Department of ECE

speak('Here is what I found for' + search)


# 5: search
if there_exists(["do google","search google","on google","search for","in google"]):
search = record_audio('What do you want to search for?')
url = 'https://google.com/search?q='+ search
webbrowser.get().open(url)
speak('Here is what I found for' + search)
# 5.6: opening youtube
if there_exists(["open the youtube","open youtube"]):
url = 'https://www.youtube.com/'
webbrowser.get().open(url)
speak('Opening')

# 5.7: opening google


if there_exists(["open the google","open google"]):
url = 'https://www.google.com/'
webbrowser.get().open(url)
speak('Opening')
# 5.7: opening gemail
if there_exists(["open gmail","open email","open my email","check email"]):
url = 'https://mail.google.com/'
webbrowser.get().open(url)
speak('Opening')

# 5.5: find location


if there_exists(["location"]):
location = record_audio('What is the locatio n?')
url = 'https://google.nl/maps/place/' + location + '/&'
webbrowser.get().open(url)
speak('Opening map of' + location )
# 6: search youtube

AI Powered Personal Assistant Page 35


Malla Reddy College of Engineering & Technology Department of ECE

if there_exists(["search youtube","search the youtube","search in youtube","in


youtube","on youtube"]):
search = record_audio('What do you want to search for?')
r.pause_threshold=2
url = 'https://www.youtube.com/results?search_query='+search
webbrowser.get().open(url)
speak('Here is what I found')
#OS shutdown
if there_exists(["shutdown system","system off","shutdown the system","system
shutdown"]):
speak('Okay system will off in 30 seconds')
os.system("shutdown /s /t 30")

if there_exists(["good","thank you","thanks","well done"]):


greetings = ["my pleasure","Don't mention","Thanks for your compliment","No
problem.","Thank you, it makes my day to hear that."]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)
if there_exists(["exit", "quit","sleep","shut up","close"]):
greetings = ["Going offline ! you can call me Anytime","Okay ,you can call me
Anytime","See you later","See you soon","Have a good day."]
greet = greetings[random.randint(0,len(greetings)-1)]
speak(greet)
exit()
time.sleep(1)
while(1):
voice_data = record_audio() # get the voice input
respond(voice_data) # respond
def chat(query):
global chatStr
print(chatStr)
openai.api_key = apikey

AI Powered Personal Assistant Page 36


Malla Reddy College of Engineering & Technology Department of ECE

chatStr += f"Harry: {query}\n Jarvis: "


response = openai.Completion.create(
model="text-davinci-003",
prompt= chatStr,
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
# todo: Wrap this inside of a try catch block
say(response["choices"][0]["text"])
chatStr += f"{response['choices'][0]['text']}\n"
return response["choices"][0]["text"]

def ai(prompt):
openai.api_key = apikey
text = f"OpenAI response for Prompt: {prompt} \n *************************\n\n"
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
# todo: Wrap this inside of a try catch block
# print(response["choices"][0]["text"])
text += response["choices"][0]["text"]
if not os.path.exists("Openai"):
os.mkdir("Openai")

AI Powered Personal Assistant Page 37


Malla Reddy College of Engineering & Technology Department of ECE

# with open(f"Openai/prompt- {random.randint(1, 2343434356)}", "w") as f:


with open(f"Openai/{''.join(prompt.split('intelligence')[1:]).strip() }.txt", "w") as f:
f.write(text)

def say(text):
os.system(f'say "{text}"')

def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
# r.pause_threshold = 0.6
audio = r.listen(source)
try:
print("Recognizing...")
query = r.recognize_google(audio, language="en-in")
print(f"User said: {query}")
return query
except Exception as e:
return "Some Error Occurred. Sorry from Jarvis"

if __name__ == '__main__':
print('Welcome to Jarvis A.I')
say("Jarvis A.I")
while True:
print("Listening...")
query = takeCommand()
# todo: Add more sites
sites = [["youtube", "https://www.youtube.com"], ["wikipedia",
"https://www.wikipedia.com"], ["google", "https://www.google.com"],]
for site in sites:
if f"Open {site[0]}".lower() in query.lower():

AI Powered Personal Assistant Page 38


Malla Reddy College of Engineering & Technology Department of ECE

say(f"Opening {site[0]} sir...")


webbrowser.open(site[1])
# todo: Add a feature to play a specific song
if "open music" in query:
musicPath = "/Users/harry/Downloads/downfall-21371.mp3"
os.system(f"open {musicPath}")

elif "the time" in query:


musicPath = "/Users/harry/Downloads/downfall-21371.mp3"
hour = datetime.datetime.now().strftime("%H")
min = datetime.datetime.now().strftime("%M")
say(f"Sir time is {hour} bajke {min} minutes")

elif "open facetime".lower() in query.lower():


os.system(f"open /System/Applications/FaceTime.app")

elif "open pass".lower() in query.lower():


os.system(f"open /Applications/Passky.app")

elif "Using artificial intelligence".lower() in query.lower():


ai(prompt=query)

elif "Jarvis Quit".lower() in query.lower():


exit()

elif "reset chat".lower() in query.lower():


chatStr = ""
else:
print("Chatting...")
chat(query)
# say(query)
engine = pyttsx3.init('sapi5')

AI Powered Personal Assistant Page 39


Malla Reddy College of Engineering & Technology Department of ECE

rate = engine.getProperty('rate')
voices = engine.getProperty('voices')
volume = engine.getProperty('volume')
engine.setProperty('rate', 180)
engine.setProperty('voice', voices[1].id)
engine.setProperty('volume', 0.8)

# Speak function
def speak(text):
engine.say(text)
engine.runAndWait()
print(text)
# Wishing in the beginning
def wish(text):
engine.say(text)
engine.runAndWait()
# Wishing user
def wishme():
hour = int(datetime.datetime.now().hour)
if hour >= 0 and hour < 12:
wish('good morning sir. how are you')
elif hour >= 12 and hour < 16:
wish('good afternoon sir. how are you')
else:
wish('good evening sir. how are you')
# Taking voice input
def takecommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print('Listening...')
audio = r.listen(source)

AI Powered Personal Assistant Page 40


Malla Reddy College of Engineering & Technology Department of ECE

r.energy_threshold = 800
r.dynamic_energy_threshold = True
r.dynamic_energy_adjustment_damping = 0.2
try:
text1 = r.recognize_google(audio)
text = text1.lower()
print('You: ' + text)
except:
return ""
return text
def sleep():
r = sr.Recognizer()
with sr.Microphone() as source:
print('Listening...')
audio = r.listen(source)
r.energy_threshold = 500
try:
text1 = r.recognize_google(audio)
text = text1.lower()
print('You: ' + text)
except:
return "none"
return text
# Logic of the program
text = ''
question = ''
type_sentence = ''
running = True
time.sleep(5)
wishme()

# Operating according to input voice

AI Powered Personal Assistant Page 41


Malla Reddy College of Engineering & Technology Department of ECE

while running:
text = takecommand()
question = text
query4 = ''
query3 = ''
query1 = ''
query5 = ''
query2 = ''
page1 = ''
page2 = ''
wakeup_txt = ''
if 'good evening' in text or 'good morning' in text or 'good afternoon' in text:
speak('how may i help you sir?')
if 'search' in text and 'in wikipedia' in text or 'search about' in text and 'in wikipedia' in
text or 'wikipedia' in text:
query1 = text.replace('wikipedia', '')
query3 = query1.replace('about', '')
query4 = query3.replace('in', '')
query5 = query4.replace('for', '')
query2 = query5.replace('search', '')
query6 = query2
speak('do you want me to narrate or open webpage sir?')
answer = takecommand()
if 'narrate' in answer or 'direct' in answer:
results = wikipedia.summary(query6, sentences=1, auto_suggest=False)
speak('according to wikipedia ' + results)
elif 'web page' in answer or 'website' in answer or 'webpage' in answer:
page1 = wikipedia.page(query2, auto_suggest=False)
print(page1)
page2 = page1.url
print(page2)
speak('redirecting to webpage')

AI Powered Personal Assistant Page 42


Malla Reddy College of Engineering & Technology Department of ECE

webbrowser.get().open_new_tab(page2)
print(page2)
elif text == '':
speak('sorry sir. can you say that again?')
elif 'search' in text and 'in google' in text:
query1 = text.replace('in google', '')
query2 = query1.replace('search', '')
speak('searching ' + query2 + ' in google')
wb.get().open_new_tab('www.google.com/search?gx&q=' + query2)
elif 'search' in text and 'in youtube' in text:
query1 = text.replace('in youtube', '')
query2 = query1.replace('search for', '')
speak('searching ' + query2 + ' in youtube')
wb.get().open_new_tab('https://www.youtube.com/results?search_query=' + query2)
elif 'search' in text:
abc1 = text.replace('search', '')
abc2 = abc1.replace('about', '')
abc3 = abc2.replace('for', '')
speak('do you want me to search in google, wikipedia or youtube sir?')
answer3 = takecommand()
if 'google' in answer3:
speak('searching for ' + abc3 + ' in google')
wb.get().open_new_tab('www.google.com/search?gx&q=' + abc3)

elif 'wikipedia' in answer3:


speak('do you want me to narrate or open webpage sir?')
answer2 = takecommand()
if 'narrate' in answer2 or 'direct' in answer2:
results = wikipedia.summary(abc3, sentences=1, auto_suggest=False)
speak('according to wikipedia ' + results)
elif 'web page' in answer2 or 'website' in answer2 or 'webpage' in answer2:
page1 = wikipedia.page(abc3, auto_suggest=False)

AI Powered Personal Assistant Page 43


Malla Reddy College of Engineering & Technology Department of ECE

print(page1)
page2 = page1.url
print(page2)
speak('redirecting to webpage')
webbrowser.get().open_new_tab(page2)
print(page2)
elif 'youtube' in answer3:
speak('searching for ' + abc3 + 'in youtube')
wb.get().open_new_tab('https://www.youtube.com/results?search_query=' + abc3)

elif 'your name' in text or text == 'what is the name':


speak('My name is Panda')
elif text == 'hi' or text == 'hello' or text == 'hai' or text == 'hello hai' or text == 'hello hi':
speak('Hello sir. how can I help you?')
elif text == 'i am fine what about you' or text == "i'm fine what about you" or 'how are
you' in text or 'what about you' in text:
speak('I am great. do you need any help sir?')
elif text == 'i am fine' or text == "i'm fine":
speak('Great! do you need any help sir?')
elif 'who created you' in text:
speak('I was created by Himanshu Chandola')
elif text == 'introduce yourself' or text == 'who are you' or text == 'tell me something
about yourself' or 'introduce yourself' in text:
speak(
'I am Panda. You can know me as personal computer and virtual assistant of
Himanshu Chandola. I was created by using python. I am 1 day old. currently, I am in
development stage.')
elif text == 'tell me something about mr chandola' or text == 'tell me something about
Himanshu Chandola' or text == 'who is himanshu Chandola' or text == 'who is mr chandola'
or text == 'who is himanshu':
speak(

AI Powered Personal Assistant Page 44


Malla Reddy College of Engineering & Technology Department of ECE

'Himanshu Chandola is a student from Graphic Era. As a practice and a small project,
he created me and I am talking to you.')
elif 'thank you' in text or 'thanks' in text:
speak('You are welcome! enything else sir?')
elif 'roll' in text and 'dice' in text:
r = random.randint(1, 6)
dice = str(r)
speak('you got ' + dice)
elif 'open instagram' in text:
speak('ok. opening instagram')
wb.get().open_new_tab('https://instagram.com')
elif text == 'quit' or text == 'panda bye' or text == 'panda quit' or text == 'bye' or 'bye' in
text or 'quit' in text:
speak('bye bye sir. thanks for your time')
running = False
sys.exit()
elif 'open youtube' in text:
speak('ok. opening youtube')
wb.get().open_new_tab('https://www.youtube.com')
elif 'open facebook' in text:
speak('ok. opening facebook')
wb.get().open_new_tab('https://www.facebook.com')
elif text == 'sing a song' or text == 'sing me a song' or 'sing a song' in text:
speak(
'I am not a good singer but I hope you will like this. Goin out tonight, changes into
something red, Her mother, doesnt like that kind of dress, Everything she never had, she
showin off')
elif 'open chrome' in text or 'open google chrome' in text:
speak('ok. opening google chrome')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Google
Chrome.lnk')
elif 'yes' in text:

AI Powered Personal Assistant Page 45


Malla Reddy College of Engineering & Technology Department of ECE

speak('how can I help you sir?')


elif 'open spotify' in text:
speak('ok. opening spotify ')
os.system('spotify')
elif 'shut down the computer' in text or 'shutdown the computer' in text or 'shot down the
computer' in text:
speak('ok shutting down the computer')
os.system('shutdown /s /f')
running = False
sys.exit()
elif 'close opera' in text:
os.system('TASKKILL /F /IM opera.exe')
speak('ok. closing opera gx browser')
elif 'close' in text and 'chrome' in text or text == 'close google chrome' or 'close google
chrome' in text:
speak('ok. closing google chrome')
os.system('TASKKILL /F /IM chrome.exe')
elif 'open access' in text or 'open axis' in text or 'open excess' in text:
speak('ok. opening access')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Access.lnk')
elif 'open photoshop' in text:
speak('ok. opening adobe photoshop 2021')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Adobe
Photoshop 2021.lnk')
elif 'open after effects' in text:
speak('ok. opening Adobe after effects 2021')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Adobe After
Effects 2021.lnk')
elif 'open illustrator' in text:
speak('ok. opening Adobe illustrator 2021')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Adobe
Illustrator 2021.lnk')

AI Powered Personal Assistant Page 46


Malla Reddy College of Engineering & Technology Department of ECE

elif 'open media encoder' in text:


speak('ok. opening Adobe media encoder 2021')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Adobe Media
Encoder 2021.lnk')
elif 'open premiere pro' in text:
speak('ok. opening adobe premiere pro 2021')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Adobe
Premiere Pro 2021.lnk')
elif 'open bluestacks' in text:
speak('Ok. opening bluestacks 5')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/BlueStacks
5.lnk')
elif 'open excel' in text:
speak('Ok. opening Excel')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Excel.lnk')
elif 'open free download manager' in text:
speak('ok. opening free download manager')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Free Download
Manager.lnk')
elif 'open edge' in text:
speak('ok. opening edge')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Microsoft
Edge.lnk')
elif 'open screen recorder' in text or 'open recorder' in text:
speak('ok. opening obs studio')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/OBS Studio
(64bit).lnk')
elif 'open one drive' in text:
speak('ok. opening one drive')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/OneDrive for
Business.lnk')
elif 'open one note' in text:

AI Powered Personal Assistant Page 47


Malla Reddy College of Engineering & Technology Department of ECE

speak('ok. opening one note')


os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/OneNote.lnk')
elif 'open outlook' in text:
speak('ok. opening outlook')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Outlook.lnk')
elif 'open powerpoint' in text:
speak('ok. opening powerpoint')
os.startfile('C:/ProgramData/Microsoft/Windows/Start
Menu/Programs/PowerPoint.lnk')
elif 'open publisher' in text:
speak('ok. opening publisher')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Publisher.lnk')
elif 'open skype' in text:
speak('ok. opening skype')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Skype for
Business.lnk')
elif 'open visual studio installer' in text:
speak('ok. opening visual studio installer')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Visual Studio
Installer.lnk')
elif 'open word' in text:
speak('ok. opening word')
os.startfile('C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Word.lnk')
speak('do you want me to type sir?')
typin = takecommand()
if 'yes' in typin:
pyautogui.press('enter')
speak('sir you can start. say stop typing if I have to stop')
while not 'stop typing' in type_sentence:
type_sentence = takecommand()
if type_sentence != 'stop typing' and type_sentence != 'press enter':
pyautogui.write(type_sentence + '. ')

AI Powered Personal Assistant Page 48


Malla Reddy College of Engineering & Technology Department of ECE

elif type_sentence == 'press enter':


pyautogui.press('enter')
speak('stopped typing')
elif 'no' in typin:
speak('ok sir')
elif 'open pycharm' in text:
speak('ok. opening pycharm')
os.startfile(
'C:/ProgramData/Microsoft/Windows/Start Menu/Programs/JetBrains/PyCharm
Community Edition 2021.1.3.lnk')
elif 'stop typing' in text:
speak('sir I already stopped typing')
elif 'time' in text:
h = datetime.datetime.now().strftime("%H,%M,%S")
speak(f"sir, the time is{h}")
elif 'open zoom' in text:
speak('ok. opening zoom')
os.startfile('C:/Users/nbhel/AppData/Roaming/Microsoft/Windows/Start
Menu/Programs/Zoom/Zoom.lnk')
elif 'close access' in text or 'close axis' in text or 'close excess' in text:
speak('ok. closing access')
os.system('TASKKILL /F /IM MSACCESS.exe')
elif 'close after effects' in text:
speak('ok. closing adobe after effects 2021')
os.system('TASKKILL /F /IM AfterFX.exe')
elif 'close illustrator' in text:
speak('ok. closing adobe illustrator 2021')
os.system('TASKKILL /F /IM AIRobin.exe')
elif 'close spotify' in text:
speak('ok. closing spotify')
os.system('TASKKILL /F /IM Spotify.exe')
elif 'close photoshop' in text:

AI Powered Personal Assistant Page 49


Malla Reddy College of Engineering & Technology Department of ECE

speak('ok. closing adobe photoshop 2021')


os.system('TASKKILL /F /IM Photoshop.exe')
elif 'close pycharm' in text or 'close python' in text:
speak('ok. closing pycharm')
os.system('TASKKILL /F /IM pycharm64.exe')
elif 'close bluestacks' in text:
speak('ok. closing bluestacks')
os.system('TASKKILL /F /IM HD-Player.exe')
elif 'close excel' in text:
speak('ok. closing excel')
os.system('TASKKILL /F /IM EXCEL.EXE')
elif 'close youtube' in text:
speak('ok. closing youtube')
pyautogui.hotkey('ctrl', 'w')
elif 'close facebook' in text:
speak('ok. closing facebook')
pyautogui.hotkey('ctrl', 'w')
elif 'close task manager' in text:
speak('ok. closing task manager')
os.system('TASKKILL /F /IM Taskmgr.exe')
elif 'close free download manager' in text:
speak('ok. closing free download manager')
os.system('TASKKILL /F /IM fdm.exe')
elif 'close edge' in text:
speak('ok. closing microsoft edge')
os.system('TASKKILL /F /IM msedge.exe')
elif 'close recorder' in text:
speak('ok. closing obs studio')
os.system('TASKKILL /F /IM obs64.exe')
elif 'close powerpoint' in text:
speak('ok. closing powerpoint')
os.system('TASKKILL /F /IM POWERPNT.EXE')

AI Powered Personal Assistant Page 50


Malla Reddy College of Engineering & Technology Department of ECE

elif 'close word' in text:


speak('ok. closing word')
os.system('TASKKILL /F /IM winword.exe')
elif 'repeat' in text:
speak('ok sir. say stop repeating if i have to stop')
repeating = ''
while repeating != 'stop repeating':
repeating = takecommand()
if repeating != 'stop repeating':
speak(repeating)
elif repeating == 'stop repeating':
speak('ok sir. repeating stopped.')
elif 'sleep' in text:
speak('ok sir goodnight')
sl_cr = ''
while not 'wake up' in sl_cr:
sl_cr = sleep()
if sl_cr == 'quit':
speak('bye bye sir. have a great day')
speak('hello again sir')
elif 'show' in text and 'mirror' in text or 'open camera' in text:
speak('ok. opening camera')
os.system('start microsoft.windows.camera:')
elif 'close' in text and 'camera' in text:
speak('ok. closing camera')
pyautogui.hotkey('alt', 'f4')
elif 'search' in text and 'in youtube' in text:
search_text1 = text.replace('search', '')
search_text2 = search_text1.replace('in youtube', '')
speak('searching for ' + search_text2 + ' in youtube')
webbrowser.get().open_new_tab('https://www.youtube.com/results?search_query=' +
search_text2)

AI Powered Personal Assistant Page 51


Malla Reddy College of Engineering & Technology Department of ECE

elif 'play' in text and 'music' in text or 'playlist' in text:


speak('ok sir enjoy your music')
os.system('spotify.exe')
time.sleep(1)
pyautogui.click(button='left')
pyautogui.press('space')
pyautogui.hotkey('alt', 'f4')
while not 'wake up' in wakeup_txt:
wakeup_txt = sleep()
if wakeup_txt == 'quit':
speak('bye bye sir. have a great day')
running = False
sys.exit()
elif 'pause' in wakeup_txt or 'play' in wakeup_txt:
os.system('spotify')
time.sleep(1)
pyautogui.press('space')
pyautogui.hotkey('alt', 'f4')
elif 'close spotify' in wakeup_txt:
os.system('TASKKILL /F /IM Spotify.exe')
speak('hello again sir')
elif 'open wikipedia' in text:
speak('ok. opening wikipedia')
webbrowser.get().open_new_tab('https://www.wikipedia.org')
else:
speak('sorry sir that is not assigned. do you want to search for ' + text + '?')
confirmation = takecommand()
if 'yes' in confirmation:
speak('do you want me to search in google, wikipedia or youtube sir?')
answer4 = takecommand()
if 'google' in answer4:
speak('searching for ' + text + ' in google')

AI Powered Personal Assistant Page 52


Malla Reddy College of Engineering & Technology Department of ECE

wb.get().open_new_tab('www.google.com/search?gx&q=' + text)
elif 'wikipedia' in answer4:
speak('do you want me to narrate or open webpage sir?')
answer2 = takecommand()
if 'narrate' in answer2 or 'direct' in answer2:
results = wikipedia.summary(text, sentences=1, auto_suggest=False)
speak('according to wikipedia ' + results)
elif 'web page' in answer2 or 'website' in answer2 or 'webpage' in answer2:
page1 = wikipedia.page(text, auto_suggest=False)
print(page1)
page2 = page1.url
print(page2)
speak('redirecting to webpage')
webbrowser.get().open_new_tab(page2)
print(page2)
elif 'youtube' in answer4:
speak('searching for ' + text + 'in youtube')
wb.get().open_new_tab('https://www.youtube.com/results?search_query=' + text)
else:
speak('ok. anything else sir?')

AI Powered Personal Assistant Page 53


Malla Reddy College of Engineering & Technology Department of ECE

APPENDIX-B
WORKING SNAPS

AI Powered Personal Assistant Page 54


Malla Reddy College of Engineering & Technology Department of ECE

AI Powered Personal Assistant Page 55


Malla Reddy College of Engineering & Technology Department of ECE

AI Powered Personal Assistant Page 56


Malla Reddy College of Engineering & Technology Department of ECE

AI Powered Personal Assistant Page 57


Malla Reddy College of Engineering & Technology Department of ECE

AI Powered Personal Assistant Page 58


Malla Reddy College of Engineering & Technology Department of ECE

AI Powered Personal Assistant Page 59

You might also like