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

Python

The document presents a project report on creating a virtual assistant using Python. It was created by 4 students as a partial fulfillment of their Bachelor of Technology degree in computer science and engineering. The project aims to build an AI assistant that can understand Indian English pronunciations and perform tasks like general conversations, searches, providing health advice, and managing schedules on desktop computers. It needs extensive training data to work effectively and should be able to optimize complex task workflows by suggesting efficient plans. The report includes sections on introduction, literature review, problem formulation, system design, implementation, results, and conclusion.

Uploaded by

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

Python

The document presents a project report on creating a virtual assistant using Python. It was created by 4 students as a partial fulfillment of their Bachelor of Technology degree in computer science and engineering. The project aims to build an AI assistant that can understand Indian English pronunciations and perform tasks like general conversations, searches, providing health advice, and managing schedules on desktop computers. It needs extensive training data to work effectively and should be able to optimize complex task workflows by suggesting efficient plans. The report includes sections on introduction, literature review, problem formulation, system design, implementation, results, and conclusion.

Uploaded by

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

A PROJECT REPORT

ON
Virtual Assistance using Python

For the partial fulfillment for the award of the degree of


BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING

Submitted By
Harsh Chaudhary (1901920100113)
Vivek Payla (1901920100331)
Sarvesh Singh (1901920100257)
Ayush Mishra (1901920100071)

Under the Supervision of


Mr.Shivam Tiwari

G.L. BAJAJ INSTITUTE OF TECHNOLOGY &


MANAGEMENT, GREATER NOIDA
Affiliated to

DR. APJ ABDUL KALAM TECHNICAL UNIVERSITY,


LUCKNOW

2022-2023

1
Declaration

We hereby declare that the project work presented in this report entitled “Virtual
Assistant using Python”, in partial fulfillment of the requirement for the award of
the degree of Bachelor of Technology in Computer Science & Engineering,
submitted to A.P.J. Abdul Kalam Technical University, Lucknow, is based on our
own work carried out at Department of Computer Science & Engineering, G.L.
Bajaj Institute of Technology & Management, Greater Noida. The work contained
in the report is true and original to the best of our knowledge and project work
reported in this report has not been submitted by us for award of any other degree
or diploma.

Signature:

Name: Harsh Chaudhary

Roll No: 1901920100113

Signature:

Name: Vivek Payla

Roll No: 1901920100331

Signature:

Name: Sarvesh Singh

Roll No: 1901920100257

Signature:

2
Name: Ayush Mishra

Roll No: 1901920100071

Date:

Place: Greater Noida

3
Certificate

This is to certify that the Project report entitled “Virtual Assistant using Python
”done by Harsh Chaudhary (1901920100113), Vivek Payla (1901920100331),
Sarvesh Singh (1901920100257) and Ayush Mishra (1901920100071) is an
original work carried out by them in Department of Computer Science &
Engineering, G.L. Bajaj Institute of Technology & Management, Greater Noida
under my guidance. The matter embodied in this project work has not been
submitted earlier for the award of any degree or diploma to the best of my
knowledge and belief.

Date:

Mr. Shivam Tiwari Dr.Sansar Singh


Chauhan

Signature of the Supervisor Head of Department

4
Acknowledgement

The merciful guidance bestowed to us by the almighty made us stick out this
project to a successful end. We humbly pray with sincere heart for his guidance to
continue forever.

We pay thanks to our project guide Mr. Shivam Tiwari who has given guidance
and light to us during this project. His/her versatile knowledge has helped us in the
critical times during the span of this project.

We pay special thanks to our Head of Department Dr. Sansar Singh Chauhan
who has been always present as a support and help us in all possible way during
this project.

We also take this opportunity to express our gratitude to all those people who have
been directly and indirectly with us during the completion of the project.

We want to thanks our friends who have always encouraged us during this project.

At the last but not least thanks to all the faculty of CSE department who provided
valuable suggestions during the period of project.

5
Abstract

Artificial intelligence is the core business of making intelligent machines,


especially computer programs. This is relevant to the well-known task of using
computers to understand human intelligence. Artificial intelligence is generally
classified as the study of computation that enables perception, reasoning, and
action. This article provides an overview of the concept of a Windows-based
personal assistant. The system is inspired by virtual assistants such as Cortana for
Windows and Siri for iOS.

It aims to provide a user-friendly interface to perform various tasks using well-


defined commands. As a personal assistant, this document focuses on assisting
end users in daily activities such as general human conversation, Google search
queries, video search, image retrieval, weather in real-time, word meanings,
medication details lookup, symptom-based health advice. and reminding users of
scheduled events and tasks. Analyzes user statements/commands using machine
learning to provide optimal solutions.

6
TABLE OF CONTENT

i) Declaration
ii) Certificate
iii) Acknowledgement
iv) Abstract

Chapter 1. Introduction …………………………………………………….10-12


1.1 Problem Statement….......................................................................10
1.2 Project Overview / Specifications ...................................................11

Chapter 2. Literature Survey ………………………………………………13-31

2.1 Introduction ……………………………………………………....13


2.2 Existing System.............................................................................. 22
2.3 Survey Of Technology……………………………………………23
Chapter 3. Problem Formulation ……………………………………….….32

Chapter 4. System Analysis & Design ……………………………….…….33-45

4.1 System Specifications ……………………………………………33


4.2 Hardware & Software Requirements………………………...…...35
4.3 System Design …………………………………………………....36

Chapter 5. Implementation………….……………………………….…….46-57

5.1 Imported Modules ……………………………………………......46


5.2 Code ……………………………………………………………...47

Chapter 6. Result & Discussion.……………………………………………58

Chapter 7. Conclusion, Limitation & Future Scope.………………….…59-60

7.1 Conclusion …………………………………………….………...59


7.2 Future Scope …………………………………………………….59
7.3 Limitation ……………………………………………………….60

v) References ……………………………………………………………………..61
Appendix I …………………………………………………………...…62
Appendix II …….……………………………………………………….63
Appendix III ...……………………………………………………………...…64

7
LIST OF FIGURES

Figure 4.1 ER Diagram ………………………………………………36

Figure 4.2 Activity Diagram……………………………………...…..37

Figure 4.3 Class Diagram……………………………………….……38

Figure 4.4 Use Case Diagram……………………………………..….39

Figure 4.5 Sequence Diagram

Figure 4.5.1 (Query Response)………………………………40

Figure 4.5.2 (Task Execution)…………………..…………...41

Figure 4.6 Data Flow Diagrams

Figure 4.6.1 DFD Level 0…………………………………...42

Figure 4.6.2 DFD Level 1…………………………….…......42

Figure 4.6.3 DFD Level 2 (Data Flow in Assistance)……....43

Figure 4.6.4 Managing User Data ………………………......43

Figure 4.6.5 Setting of Virtual Assistant ………………...…44

Figure 4.7 Component Diagram ………………………………...….45

8
Figure 5.1 Code ……………………………………………….……47

Figure 5.2 Code…………………………………………………….48

Figure 5.3 Code …………………………………………………….49

Figure 5.4 Code …………………………………………………….50

Figure 5.5 Code …………………………………………………….51

Figure 5.6 Code …………………………………………………….52

Figure 5.7 Code …………………………………………………….53

Figure 5.8 Code …………………………………………………….54

Figure 5.9 Code …………………………………………………….55

Figure 5.10 Code …………………………………………………...56

Figure 5.10 Code …………………………………………………...57

9
10
Chapter 1

Introduction

1.1 Problem Statement

Normally, client necessities to physically deal with numerous arrangements of


utilizations to finish one task. For instance, a client attempting to make a
movement arrangement requirements to check for air terminal codes for close by
air terminals and afterward check travel destinations for tickets between blends of
air terminals to arrive at the objective. There is need of a framework that can
oversee errands easily.

We as of now have different menial helpers. In any case, we scarcely use it. There
are number of individuals who have issues in voice acknowledgment. These
frameworks can figure out English expressions however, they neglect to perceive
in our articulation. Our method of elocution is way particular from theirs.
Likewise, they are not difficult to use on cell phones than work area frameworks.
There is need of a virtual right hand that can grasp English in Indian pronunciation
and work on work area framework.

At the point when a menial helper can't respond to questions precisely, this is on
the grounds that it needs the legitimate setting or doesn't figure out the goal of the
inquiry. Its capacity to reply questions pertinently just occurs with thorough
advancement, including the two people and AI. Consistently guaranteeing strong
quality control methodologies will likewise help make due the gamble of the
remote helper learning undesired terrible ways of behaving. They require
enormous measure of data to be taken care of for it to productively work.

11
Menial helper ought to have the option to show complex assignment conditions
and utilize these models to suggest streamlined plans for the client. It should be
tried for seeing as ideal ways when an undertaking has different sub-errands and
each sub-errand can have its own sub-assignments. In such a case there can be
different answers for ways, and the considering user ought to be capable
inclinations, other dynamic errands, needs to suggest a specific arrangement.

1.2 Problem Overview

A virtual assistant is a PC program intended to reproduce discussion with human


clients, regularly by means of text or voice connections. In Python, there are a few
libraries and devices accessible that can be utilized to foster a menial helper, like
the Normal Language Tool stash (NLTK), the Discourse Acknowledgment
library, and the Text-to-Discourse (TTS) library.

Here's a general overview of the steps involved in creating a virtual assistant using
Python:

· Choose a platform: Decide on the platform where your virtual


assistant will be hosted. This can be a web-based platform, a desktop
application, or a mobile app.

· Define the functionality: Define the specific tasks and functions that
your virtual assistant will perform. For example, you may want it to
answer questions, provide information, schedule appointments, play
music, or perform other tasks.

· Choose a speech recognition engine: Select a speech recognition


engine to enable voice interaction with the virtual assistant. One
popular library is Speech Recognition, which provides support for
various speech recognition engines such as Google Speech
Recognition, CMU Sphinx, and Wit.ai.

12
· Implement natural language processing: Use natural language
processing (NLP) techniques to analyze user input and extract
relevant information. The NLTK library can be used for this purpose,
providing functions for tokenization, part-of-speech tagging, and
named entity recognition.

· Develop the response system: Based on the user input and the
extracted information, develop a system to generate appropriate
responses. This could involve using pre-built response templates or
generating responses dynamically based on the input.

· Integrate text-to-speech: Integrate a text-to-speech (TTS) library to


enable the virtual assistant to speak its responses. Popular TTS
libraries include pyttsx3 and gTTS.

· Test and refine: Test the virtual assistant and refine it based on user
feedback and usage data.

13
Chapter 2

Literature Survey

2.1 Introduction

A virtual assistant operates devices such as laptops and PCs at your discretion. A
virtual assistant is an application software that can perform functions for users by
understanding natural language via voice instructions. A virtual assistant is used to
perform routine duties such as displaying the date and time, managing emails,
opening apps, and so on. Virtual assistants are currently quite useful to people.
The ability to operate PCs or laptops purely using voice commands simplifies
people's lives. Using it means saving time. We can contribute to multiple projects
while saving time by using a virtual assistant. Virtual assistants are typically
cloud-based applications that require internet-connected devices. The ability to
employ a virtual assistant solely for the services they require. Begin by learning
the principles of Python in order to develop a virtual assistant for your computer.

Virtual assistants concentrate on their tasks. The virtual assistant's ability to


understand and carry out orders. A virtual assistant is a computer programme that
recognises verbal and written directions and completes client-supplied tasks.
Virtual assistants can understand spoken language and respond with voice
synthesised responses.

There are several speech assistants on the market, including Alexa, a Raspberry
Pi-powered smart speaker, Siri for the Apple TV remote, Google Assistant for the
Pixel XL smartphones, and Microsoft Cortana for Windows 10.We created a
virtual assistant for Windows, similar to all other virtual assistants. We apply
artificial intelligence technology for this project. Python can also be used as a

14
programming language because it has several outstanding Main Libraries.

A microphone is utilised as an input device for this programme to capture user


voice instructions, and a speaker is used as an output device to transmit the output
voice. This method incorporates several technologies, including language
processing, speech recognition, and voice analysis.Virtual assistants employ NLP
to turn user text or voice command into executable commands. When a user asks a
personal virtual assistant to perform a task, natural language is used to transform
voice impulses into digital signals.

Coming to our assistant our assistant can perform various tasks:-

1. Google Search

2. YouTube Search

3. Wikipedia Search

4. YouTube Control

5. Speed Test

6. Shutdown / Restart System

7. Open / Close any App

8. Screen Shot

9. Translate

10. Search in Hindi

15
We will also be including a Graphical User Interface(GUI). The GUI will increase
the convinience of the user in using the software.

10. Google Search

Command to be given:-

Output:-

Assistant will read out about the search user just did and also open the browser
with search.

16
11. Youtube Search

Command to be given:-

Output:-

The assistant will open


the first video that comes.

12. Wikipedia Search

17
Command to be given:

Output:-

13. YouTube Control

Command to be given:

14. Speed Test

18
Command to be given:-

Output:-

Output for Speed Test


will be a GUI showing
the speed as well as the
assistant will tell the
download and upload
speed seperately.

15. Shutdown / Restart System

19
Command to be given:

Output:

20
16. Open / Close any App

Command to be given:

Output:

17. Translate

21
Command to be given:

Output:

18. ScreenShot

Command to be given:

2.2 Existing System

22
Many virtual office assistants already exist. This section presents several examples
of virtual assistants currently available on the market, as well as the tasks they can
provide and their shortcomings.

SIRI

SIRI is personal assistant software that communicates with users through a voice
interface, recognizing and responding to commands. It learns to adapt to the user's
voice, improving speech recognition over time. It also tries to talk to the user
when it doesn't recognize the user's request.

It integrates with the device's calendar, contacts, and music library apps, as well as
the device's GPS and camera. It uses location, time, social and task-based context
to customize agent behaviour specific to a user at a given time.

2.3 Survey of Technology

23
Python

Python is a significant level programming language that was first delivered in


1991. It is known for its effortlessness, meaningfulness, and straightforwardness,
pursuing it a famous decision for novices and prepared software engineers the
same. Python upholds an assortment of programming ideal models, including
object-situated, procedural, and practical programming.

A portion of the critical elements of Python are:


Simplicity of learning: Python has a straightforward grammar and is not difficult
to peruse and compose, making it an incredible language for novices.
Portrayal: Python code is deciphered at runtime, empowering fast turn of events
and testing.
Dynamic composing: Python utilizes dynamic composing; this implies that the
sort of the not entirely settled at runtime.
Huge libraries: Python has an enormous library of layouts for some capabilities
like discoursed, information I/O, and normal articulations.
Cross-stage: Python can run on many working frameworks, including Windows,
Macintosh, and Linux.

Python has numerous applications including web improvement including research,


information examination and man-made consciousness. It has an enormous and
solid local area of clients and engineers, which tremendously affects outsider
libraries and devices.

Pyttsx

24
Pyttsx3 is a Python library that provides a simple and easy-to-use interface for
converting text to speech. It supports multiple speech engines, including eSpeak,
Festival, and Microsoft Speech API (SAPI). The library allows you to customize
the properties of the speech, such as the rate, volume, and voice. It provides event-
driven and blocking modes for speech output, and can be used with Python 2 and
Python 3.

Using pyttsx3, you can create a pyttsx3 object by calling the init() method, and
then use the say() method to convert text to speech. The runAndWait() method is
used to run the speech. You can also set the properties of the pyttsx3 object, such
as the rate of speech, the volume, and the voice. This allows you to customize the
speech output to better suit your needs.

Pyttsx3 is a useful library for a wide range of applications, including text-to-


speech applications, speech-enabled user interfaces, and assistive technology for
individuals with visual or cognitive impairments

Speech Recognition

SpeechRecognition: This is a Python library for performing speech recognition,


with support for several speech recognition engines including Google Speech
Recognition, Sphinx, and Wit.ai.

PyAudio: This is a Python library for audio input and output, which can be used in
conjunction with other speech recognition modules to capture audio input.

These speech recognition modules can be used in a variety of applications, such as


voice assistants, speech-to-text transcription, and audio analysis.

Web Browser

25
Python has a built-in module called webbrowser that allows you to control the
web browser installed on your computer and open web pages from within a
Python script.

Here are some common functions of the webbrowser module:


webbrowser.open(url, new=0, autoraise=True) - This function opens the URL in
the default web browser. The new parameter specifies the type of window to open
the URL in. The default value is 0, which opens the URL in the same window.
Setting it to 1 opens the URL in a new window, and 2 opens the URL in a new
tab, if possible. The autoraise parameter determines whether to bring the window
to the foreground.

webbrowser.open_new(url) - This function opens the URL in a new window of


the default browser.

webbrowser.open_new_tab(url) - This function opens the URL in a new tab of the


default browser.

PyAutoGUI

PyAutoGUI is a Python library that allows you to automate tasks by simulating


mouse movements, keyboard presses, and other GUI interactions. It is useful for
tasks such as GUI testing, automating repetitive tasks, or controlling an
application that doesn't provide an API.

PyAutoGUI also provides methods for typing text, pressing keys, taking
screenshots, and more.

PyWhatKit

26
Pywhatkit is a Python library that permits clients to mechanize a few undertakings
on their PC utilizing Python code. A portion of the undertakings that can be
computerized utilizing Pywhatkit incorporate sending WhatsApp messages,
looking for data on Google, playing YouTube recordings, producing QR codes,
switching message over completely to manually written notes, and some more.

To utilize Pywhatkit, you first need to introduce it on your PC utilizing pip. You

can do this by running the accompanying order in your terminal or order brief:

Whenever you have introduced Pywhatkit, you can bring it into your Python code
and begin utilizing its capabilities. For instance, to send a WhatsApp message
utilizing Pywhatkit, you can utilize the accompanying code:

This code will send a WhatsApp message to the telephone number


"+919876543210" with the message "Hi, this is a test message" at 2:30 PM
(14:30) on the ongoing day.

Pywhatkit gives numerous different capabilities that you can use to robotize
different assignments on your PC.

PyWikiHow

The PyWikiHow module is a Python library that permits clients to get to and
recover how-to articles from the site wikiHow. With the PyWikiHow module, you
can look for how-to articles, recover directions and steps, and concentrate explicit
areas or sentences from the articles.

27
To utilize the PyWikiHow module, you first need to introduce it on your PC
utilizing pip. Whenever you have introduced the PyWikiHow module, you can
bring it into your Python code and begin utilizing its capabilities.

OS

The os module is a built-in Python library that provides a way to interact with the
operating system. With the os module, you can perform various tasks such as file
and directory operations, process management, and environment variables
manipulation.

Wikipedia

The Wikipedia module is a Python library that permits clients to collaborate with
the Wikipedia Programming interface and concentrate data from Wikipedia
articles. With the Wikipedia module, you can look for articles, recover article
synopses, and concentrate explicit areas or sentences from articles. To utilize the
Wikipedia module, you first need to introduce it on your PC utilizing pip. You can
do this by running the accompanying order in your terminal or order brief.

Whenever you have introduced the Wikipedia module, you can bring it into your
Python code and begin utilizing its capabilities. To recover an outline of a
Wikipedia article, you can utilize the rundown() capability.

For instance: This code will recover a rundown of the Wikipedia article on the
Python programming language and print it to the control center. There are
numerous different capabilities that you can use with the Wikipedia module to
extricate data from Wikipedia articles.

28
Tkinter

Tkinter is a Python library used to create graphical user interfaces (GUIs). It


provides a set of tools and widgets for building windows, buttons, menus,
textboxes, and other interactive elements of a GUI.

Tkinter comes pre-installed with most versions of Python, so you don't need to
install anything separately to use it. To get started, you can import Tkinter by
using the following code:

import tkinter as tk

DateTime

datetime is a Python module that provides classes for working with dates, times,
and time intervals. The datetime module contains four main classes: date, time,
datetime, and timedelta.

Here's a brief overview of each class:

date: represents a date (year, month, and day) in the Gregorian calendar. You can
create a date object using the date(year, month, day) constructor.

time: represents a time (hour, minute, second, microsecond) without a date. You
can create a time object using the time(hour, minute, second, microsecond)
constructor.

datetime: represents a date and time together. You can create a datetime object
using the datetime(year, month, day, hour=0, minute=0, second=0,
microsecond=0) constructor.

29
SpeedTest

speedtest-cli is a Python package that allows you to test the speed of your internet
connection from the command line. It works by connecting to a nearby server and
measuring the upload and download speeds.

Install speedtest-cli by running the following command:

pip install speedtest-cli

Pygame

Pygame is a Python library that provides functionality for building games and
multimedia applications. It is built on top of the SDL (Simple DirectMedia Layer)
library, which provides low-level access to audio, keyboard, mouse, joystick, and
graphics hardware.

PIL

PIL (Python Imaging Library) is a Python library for working with image files.
PIL provides a number of modules for image processing, including Image,
ImageDraw, ImageEnhance, ImageFilter, and ImageOps.

30
GTTS (Google Text-To –Speech)

GTTS stands for "Google Text-to-Speech," which is a technology developed by


Google that allows users to convert written text into spoken words. With GTTS,
you can type in a phrase or sentence and have it read aloud by a computer-
generated voice.

GTTS is often used in various applications and services, such as screen readers,
language learning apps, and virtual assistants, among others. It is available in
several languages and can be accessed through an API, making it easy to integrate
with different platforms and devices.

Overall, GTTS is a useful tool for anyone who needs to convert written text into
spoken words quickly and efficiently.

GoogleTrans

Googletrans is a Python library that uses the Google Translate API to provide easy
access to machine translation capabilities. It allows developers to easily translate
text from one language to another using Google's powerful translation engine. The
library supports a wide range of languages and provides advanced features such as
automatic language detection and transliteration. Googletrans can be used for a
variety of purposes, from translating website content to building multilingual
chatbots. However, it's important to note that Google's terms of service limit the
number of translations that can be made using the API without paying for
a subscription.'

31
PlaySound

Playsound is a Python library for playing audio files. It provides a simple interface
for playing WAV files on Windows and Mac operating systems. The library is
easy to install using the pip package manager and can be used in a variety of
applications, such as playing sound effects in games, playing music in a
command-line interface, or providing audio feedback in an interactive application.
The playsound library works by launching an external media player program (e.g.,
Windows Media Player on Windows or QuickTime Player on Mac) and
instructing it to play the audio file. This means that the behavior of the library may
vary depending on the media player installed on the user's system.

Pynput

Pynput is a Python module for controlling and monitoring input devices such as
keyboards and mice. It provides a simple interface for interacting with input
devices, making it simple to automate and handle numerous computer operations.

Pynput allows you to imitate keystrokes and mouse clicks, read and monitor
keyboard and mouse inputs, and manipulate the location of the mouse pointer.
This library has several uses, including automation, gaming, and accessibility
tools.

Pynput supports two basic input device control and monitoring classes: keyboard
and mouse. The keyboard class handles delivering keystrokes and hotkeys,
whereas the mouse class handles managing the mouse pointer's location and
clicking mouse buttons.

To summarise, Pynput is a robust Python package that allows you to effortlessly


automate and manipulate input devices. Pynput can help you reach your goals
whether you're creating a game or an automated script.

32
Chapter 3

Problem Formulation

As we all know, everyone has unique characteristics and every developer has their
own approach and approach to product development.

One assistant can synthesize speech more qualitatively, another can perform tasks
more accurately without additional interpretation or correction, and the other can
perform a narrower range of tasks more accurately depending on the needs of the
audience.

Therefore, there is no wizard that can perform all jobs and tasks in the same way.
The range of qualities of an assistant depends on the areas of development that
receive the most attention. Since all systems are based on machine learning and
use large amounts of data collected from various sources and then trained on it,
the origin of this data plays an important role.

No matter how different methods are used to learn different algorithms, the
fundamentals of creating a voice assistant are the same. Speech recognition,
phonetics education, voice biometrics, conversation managers, natural language
understanding and named entity recognition are technologies used to create voice
assistants that can communicate with people.

33
Chapter 4

System Analysis & Design

4.1 System Specification

Personal assistant software should act as an interface into the digital world,
understanding user requests or commands and translating them into actions or
recommendations based on the agent's understanding of the world.

The JIA focuses on eliminating the need for users to enter text, instead relying on
speech as the user's primary mode of input. The agent then uses a voice
recognition algorithm on that entry and records it. It then uses this entry to call one
of the personal information management applications, such as To-Do List, to save
a new entry, or to search for it on search engines such as Google, Bing, or Yahoo.
The focus is on capturing user input by voice, recognizing the input, and then
executing the task if the agent understands it.

The software interprets this natural language input, making it easier for the user to
grasp what they want to accomplish.

The voice recognition software enables hands-free application operation and


allows users to interrogate or command agents through a voice interface. This
allows users to interact with the agent while performing other tasks, which adds to
the overall value of the system. JIA also offers ubiquitous connectivity via Wi-Fi
or LAN, allowing distributed applications to take advantage of other web-exposed
APIs without storing them locally.

Our assistant is capable of doing various day-to-day activites viz:-

1. Google Search

34
2. Youtube Search

3. Wikipedia Search

4. Youtube Control

5. Speed Test

6. Shutdown / Restart System

7. Open / Close any App

8. Screen Shot

9. Translate

10. Search in hindi

35
4.2 HARDWARE AND SOFTWARE REQUIREMENTS

The software is designed to be lightweight so as not to overload the machine it is


running on. The system is built with common hardware and software compatibility
in mind. Below are the minimum hardware and software requirements for virtual
assistants.

Hardware:

• Pentium-pro processor or later.

• RAM 512MB or more.

Software:

• Windows 7(32-bit) or above. • Python 2.7 or later

• Chrome Driver

36
4.3 System Design

4.3.1 ER DIAGRAM

Fig 4.1

The diagram above illustrates the entities and relationships of the virtual assistant
system. System users can access their keys and values. It can be used to store all
user related data. Let's say "Jim" is a possible value for the key "name". Users may
wish to keep certain keys in a safe place.

The same user can ask several requests. Each question has its own ID so that it can
be identified with the question and accompanying answers. A user can work on
several things. Each of them should have a unique id and state, or whatever state it
is currently in.

Whether it is a parent task or a subtask of a parent job, a task must also have a
priority value and its category.

37
4.
3.
2

ACTIVITY DIAGRAM

Fig 4.2

The system is initially in standby mode. It starts executing as soon as it gets a


wake-up call. It is determined whether the instruction being received is a task to
be completed or a questionnaire. Hence, specific action is done. The system waits
for another command after the question has been answered or the operation has
been completed. Unless a command to stop is received, this loop keeps going. It
immediately falls back asleep at that point.

38
4.3.3 CLASS DIAGRAM

Fig 4.3

The class user has two attributes: an audio command that it gives and an audio
response that it receives. It works by listening to user commands. After
interpreting it, respond or send a response back in line with it. The command is
present in string form in the question class after interpret class interprets it. Based
on its identity, it delivers it to the general, about, or search functions.

The task class also includes interpreted string-format commands. It can do a


number of different tasks, including reader, mimic, note, and reminder.

39
4.3.4 USE CASE DIAGRAM

Fig 4.4

One user is all there is in this project. The system receives a command from the
user. The system then understands it and retrieves the response. The user receives
the response in return.

40
4.3.5 SEQUENCE DIAGRAM

4.3.5.1 Sequence diagram for Query-Response

Fig 4.5.1

The sequence diagram up top demonstrates how a user's question is answered by


retrieving it from the internet. The audio search is translated and forwarded to the
web scraper. The web scraper looks for the solution and finds it. The response is
then spoken to the user after being sent back to the speaker.

41
4.3.5.2 Sequence diagram for Task Execution

Fig 4.5.2

The user gives an audio command to the virtual assistant. The interpreter receives
the command. It recognises the request made by the user and sends it to the task
executor. The virtual assistant contacts the user again if any information is missing
from the job. The task is completed after the information is received and provided
back to it. Following execution, the user receives feedback.

42
4.6 DATA FLOW DIAGRAM

4.6.1 DFD Level 0 (Context Level Diagram)

Fig 4.6.1

43
4.6.2 DFD Level 1
Fig.4.6.2

4.6.3 DFD Level 2


Data Flow in Assistance (Fig 4.6.3)

44
Managing User Data
Fig(4.6.4)

Settings of virtual Assistant


Fig(4.6.6)

45
4.3.7 COMPONENT DIAGRAM

Fig 4.7

46
Chapter 5

Implementation

5.1 Imported Modules

1. pyttsx3

2. speech recognition

3. pyautogui

4. os

5. datetime

6. pynput

7. pywhatkit

8. wikipedia

9. webbrowser

10. speedtest

11. googletrans

12. gtts

13. playsound

47
5.2 Code

Fig 5.1

48
Fig 5.2

49
Fig 5.3

50
Fig 5.4

51
Fig 5.5

52
Fig 5.6

53
Fig 5.7

54
Fig 5.8

55
Fig 5.9

56
Fig 5.10

57
Fig 5.11

58
Chapter 6

Result & Discussion

Virtual assistants consume less time. A virtual assistant is software that


recognizes spoken or written commands and performs tasks assigned by
customers. Virtual assistants use natural language processing (NLP) to
match the user's voice or text input with executable commands. You can run
your machine, like a laptop or desktop, on your own using a virtual assistant.
This is a quick process, which saves time.

Virtual assistants are there for you at specific times, so you can always use
them and adapt quickly to changing needs.

Virtual assistants will be at your service, as well as others such as family and
colleagues if their workload allows.

59
Chapter 7

Conclusion, Limitation & Future Scope

7.1 Conclusion

In this report, we discuss the purpose, method, and implementation details of a


desktop personal voice assistant using Python built with the open-source software
VSCode as the implementation tool. The project will be useful for all generations,
as well as people with certain disabilities or special circumstances. The personal
voice assistant will be easy to use and reduce the human labour required to
perform various tasks. The functionality of the current voice assistant system is
limited to computer and online work (requires an internet connection to perform
tasks). Voice assistant systems are modular in nature so that new functionality can
be added without interfering with current system functionality.

7.2 Future Scope

Multilingual support: With advances in natural language processing (NLP),


Python virtual assistants could be designed to understand and respond to multiple
languages, making makes them easier to reach a global audience.

Machine learning integration: Python virtual assistants can be trained using


machine learning techniques to improve their accuracy and response time.

These are some technological aspects which are required not only in our project
but also in most other virtual assistants.

Future scope for our assistant are:

Whatsapp Automation: WhatsApp automation is the prime future scope for our
project it will not only send and read out your messages but also will be able to
upload status just by using voice command.

60
Google Maps Automation:

As technology advances, the range of virtual assistants using Python will only
grow, and we can expect to see them integrated into every aspect of our daily
lives.

7.3 Limitations

Some of the key limitations of virtual assistants include:

Limited understanding: While virtual assistants are becoming more sophisticated


in their ability to understand natural language, they still have limitations in their
understanding of context, nuance, and sarcasm.

Privacy concerns: Virtual assistants are always listening and recording, which can
raise privacy concerns for some users. There have been instances of virtual
assistants recording conversations without user consent or accidentally activating
in response to background noise.

Reliance on internet connectivity: Virtual assistants require an internet connection


to function, which can be a limitation in areas with poor connectivity or during
internet outages.

Despite these limitations, virtual assistants can still be useful tools for many users
and have the potential to become even more sophisticated in the future.

61
References

1. Krishna, T. S. R. S. (2021). Virtual Personal Assistant for Desktop Automation


using Selenium. International Journal for Research in Applied Science and
Engineering Technology, 9(VI), 3261–3264.
https://doi.org/10.22214/ijraset.2021.35798

2. Anjali Fapal, Trupti Kanade, Bharati Janrao, Mrunalini Kamble,Megha


Raule(2021), PERSONAL VIRTUAL ASSISTANT FOR WINDOWS USING
PYTHON
https://www.irjmets.com/uploadedfiles/paper/volume3/issue_7_july_2021/1427
5/1628083554.pdf

3. Vishal Kumar Dhanraj, Lokeshkriplani, Semal Mahajan (2022), Desktop Voice


Assistant, Retrieved from https://www.ijres.org/papers/Volume-10/Issue-2/Ser-
3/C10021520.pdf

4. Sharma, Y. K., & Sharma, N. (2018). A Review Paper on Smart Personal


Assistant – IJERT. A Review Paper on Smart Personal Assistant – IJERT.
https://doi.org/10.17577/IJERTCONV4IS32016

5. I., Agrawal, H., Singh, N., Kumar, G., Yagyasen, D. D., & Vikram Singh, M.
S. (2021). Research Paper on Voice Assistant Using Python, Retrieved from
https://ijirt.org/Article?manuscript=152099

62

You might also like