A.I Assistant: Nandha Arts and Science College

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 55

A.

I ASSISTANT

A Project work submitted in partial fulfillment of the requirements for the award of the degree of
BACHELOR OF COMPUTER APPLICATIONS of BHARATHIAR UNIVERSITY, Coimbatore-46.

Submitted by

BITTU VERMA B

(Reg. No. 2022J0577)

Under the Guidance of

Dr. D. KAVITHA MCA., M.Phil., Ph.D.,

(Asst. Professor, Department of Computer Applications)

MARCH - 2023

DEPARTMENT OF COMPUTER APPLICATIONS

NANDHA ARTS AND SCIENCE COLLEGE


(Affiliated to Bharathiar University, Accredited by NAAC with ‘B+’ Grade)

ERODE - 52

1
NANDHA ARTS AND SCIENCE COLLEGE
(Affiliated to Bharathiar University, Accredited by NAAC with ‘B+’ Grade)

ERODE - 52.

DEPARTMENT OF COMPUTER APPLICATIONS

CERTIFICATE

This is to certify that the Project Work entitled

A.I ASSISTANT

is a record of original work done by

BITTU VERMA B

(Reg. No. 2022J0577)

In partial fulfillment of the requirements for the award of the degree of

BACHELOR OF COMPUTER APPLICATIONS

Guide Head of the Department


(Dr.D. KAVITHA) (Ms. S.N SANTHALAKSMI)

Submitted for the University viva-voce Examination held on______________

Internal Examiner External Examiner

2
Santhila DataBot Private Limited,

DATE:

TO WHOM SOVER IT MAY IN OUR CONCERN


This is to certify that Mr. B. BITTU VERMA (2022J0577) III BCA
student of Nandha Arts and Science College had done project work in our
concern entitled” A.I ASSISTANT”.

During this period his conduct and character was found to be good.

For Santhila DataBot Private Limited,

3
DECLARATION

I hereby declare that this project entitled “A.I ASSIATANT” submitted to the

BHARATHIAR UNIVERSITY, in partial fulfillment of the requirements for the award of the

degree of BACHELOR OF COMPUTER APPLICATIONS is a record of original project work

done by me during 2020-2023 under the supervision and guidance of Dr. D.

KAVITHA,MCA., M.Phil.,Ph.D., Asst. Professor, Department of Computer Applications,

Nandha Arts and Science College, Erode, and that it has not formed the basis for award of

any Degree / Diploma / Associate ship / Fellowship or similar title to any candidate of any

University.

Place : Erode Signature of the Candidate


Date : (BITTU VERMA B)

4
ACKNOWLEDGEMENT

I would like to express my sincere thanks and gratitude to Mr. V. SHANMUGAN,


B.Com. Chairman, Nandha Educational Trust for the constant help and support from the
beginning of the course.

I also record immense thanks to Dr. S. MANOHARAN, M.A., M.A., M. Phil., Ph.D.,
Principal, Nandha Arts and Science College, Erode, for the valuable advice and suggestion he
gave us to accomplish this task successfully.

I extend my gratefulness to our Head of the Department


Ms S.N SANTHALAKSMI, MCA., M.Phil., Ph.D., Department of Computer Applications, for
having given me constant encouragement.

I express my grateful thanks to Dr. D. KAVITHA, MCA., M.Phil., Ph.D., Asst.


Professor, Department of Computer Applications, for her valuable ideas, advice and
guidance in completing this project.

I would like to express my heartful thanks to all the faculty members of the
Department of Computer Applications, Nandha Arts and Science College, Erode, who have
helped me directly or indirectly for successful completion of this project work.

It is my duty to express my heartful gratitude to my Parents, Friends and all Well


Wishers for their timely help.

5
ABSTRACT

The A.I. a personal voice assistant that used to take the user commands as input and
perform tasks based on the user commands.

It provides more efficient and natural interaction with support of voice commands in
the same utterance. This assistant has a unique speech recognition technique through which
only the authorized user can provide the command to the assistant and can perform their
various tasks on system.

A.I Assistant might perform include scheduling appointments, making phone calls,
making travel arrangements, and managing email accounts. Some A.I assistants specialize in
offering graphic design, blog writing, bookkeeping, social media, and marketing services .

My system proposed to do open Chrome, YouTube, Intimate alert message, open


Wikipedia. Thus, my system can be used for the doing the multi-purpose tasks in robust and
flexible approaches.

The Methodology of A.I is speech recognition module, API calls, Content Extraction,
Text to speech module.

The proposed concept is resolved by using PyCharm

6
CONTENTS

SI.NO TITLE DESCRIPTION PAGE NO.

INTRODUCTION 7
1.1 ORGANIZATION PROFILE 4
1.2 SYSTEM SPECIFICATION 5
I 1.2.1 HARDWARE CONFIGURATION 5
1.2.2 SOFTWARE SPECIFICATION 5
1.3 SOFTWARE DESCRIPTION 6

SYSTEM STUDY 11
2.1 EXISTING SYSTEM 11
2.1.1 DRAWBACKS OF EXISTING SYSTEM 10
II 2.2 PROPOSED SYSTEM 11
2.2.1 FEATURES OF PROPOSED SYSTEM 11

SYSTEM DESIGN AND DEVELOPMENT 12


3.1 FILE DESIGN 12
3.2 INPUT DESIGN 12
3.3 OUTPUT DESIGN 13
III
3.4 DATABASE DESIGN 14
3.5 SYSTEM DEVELOPMENT 15
3.5.1 DESCRIPTION OF MODULES 16
IV SYSTEM TESTING AND IMPLEMENTATION 20
CONCLUSION 23
BIBLIOGRAPHY 24
APPENDICES 25
A. DATA FLOW DIAGRAM 25
V B. SAMPLE CODE 29
C. SAMPLE INPUT 38
D. SAMPLE OUTPUT 45

1.INTRODUCTION

7
Today the development of artificial intelligence (AI) systems that can organize a
natural human-machine interaction such as voice, communication, gestures, facial
expressions, and more are gaining in popularity. One of the most studied and popular was the
direction of interaction, based on the understanding of the machine language. It is no longer a
human who learns to communicate with a machine, but a machine learns to communicate
with a human, exploring his actions, habits, behaviour and trying to become his personalized
assistant.

A.I assistants are software programs that help us ease our day-to-day tasks, such as
showing weather reports, creating remainders, making shopping lists etc. They can take
commands via text (online chatbots) or by voice. Voice-based intelligent assistants need an
invoking word or wake word to activate the listener, followed by the command. They are so
many virtual assistants, such as Apple’s Siri, Amazon’s Alexa and Microsoft’s Cortana.

Personal assistants’ software improves user productivity by managing routine tasks


of the user and by providing information from an online source to the user.

Project was started on the premise that there is a sufficient amount of openly
available data and information on the web that can be utilized to build a virtual assistant that
has access to making intelligent decisions for routine user activities.

In the 1990s, digital speech recognition technology became a feature of the personal
computer with IBM, Philips and Lernout & Hauspie fighting for customers. Much later the
market launch of the first smartphone IBM Simon in 1994 laid the foundation for smart
virtual assistants as we know them today.

Birth of smart A.I assistants: 1990s–2010s


In 1997, Dragon's Naturally Speaking software could recognize and transcribe natural
human speech without pauses between each word into a document at a rate of 100 words per
minute. A version of Naturally Speaking is still available for download and it is still used
today, for instance, by many doctors in the US and the UK to document their medical
records.

8
In 2001 Colloquies publicly launched Smarter Child, on platforms like AIM and MSN
Messenger. While entirely text-based Smarter Child was able to play games, check the
weather, look up facts, and converse with users to an extent.

The first modern digital A.I assistant installed on a smartphone was Siri, which was
introduced as a feature of the iPhone 4S on 4 October 2011. Apple Inc. developed Siri
following the 2010 acquisition of Siri Inc., a spin-off of SRI International, which is a research
institute financed by DARPA and the United States Department of Defence Its aim was to aid
in tasks such as sending a text message, making phone calls, checking the weather or setting
up an alarm. Over time, it has developed to provide restaurant recommendations, search the
internet, and provide driving directions.

In November 2014, Amazon announced Alexa alongside the Echo.

In April 2017 Amazon released a service for building conversational interfaces for


any type of virtual assistant or interface.

Artificial intelligence and language models: 2020s-present


In the 2020s, artificial intelligence (AI) systems like ChatGPT have gained popularity
for their ability to generate human-like responses to text-based conversations. In February
2020, Microsoft introduced its Turing Natural Language Generation (T-NLG), which was
then the "largest language model ever published at 17 billion parameters. On November 30,
2022, ChatGPT was launched as a prototype and quickly garnered attention for its detailed
responses and articulate answers across many domains of knowledge. The advent of
ChatGPT and its introduction to the wider public increased interest and competition in the
space. In February 2023, Google began introducing an experimental service called "Bard"
which is based on its LaMDA AI program to generates text responses to questions asked
based on information gathered from the web.

9
1.1 ORGANIZATION PROFILE

Santhila DataBot Private Limited is an emerging young IT Solutions Company


located at 121, Akhil Plaza 1st Floor, Perundurai Road, Erode, Tamil Nadu 638011 that offers
a complete range of solutions with uncompromising quality and value-added IT Solutions and
services.

Santhila DataBot Private Limited is committed to do full-stack development team


providing solutions since 2007, and has experience in the development, maintenance of ERP,
CRM, Web/Mobile Applications, Websites, SEO and SMM Team Consist of Business
Analyst, Project Managers, Team Leads, Designer, Front end developer, Back-end developer,
and QC.

It’s engagement models with their clients are flexible, scalable, secure and custom
defined, based on the specific individual needs of our customers. They follow the right
strategy to ensure business transformation and ensuring 100% success for our customer’s
business and in the process ensuring business continuity for us.

10
1.2 SYSTEM SPECIFICATION

1.2.1 HARDWARE CONFIGURATION

MONITOR : 15.6” FULL HD WVA DISPLAY

PROCESSOR : INTEL

HARD DISK : 250 GB

MOUSE : OPTICAL MOUSE

KEYBOARD : 1.4 MULTIMEDIA

RAM : 8GB

1.2.2 SOFTWARE SPECIFICATION

OPERATING SYSTEM : WINDOWS 10,11

FRONT END : PYTHON

11
1.3 SOFTWARE DESCRIPTION
PYTHON

Python is a computer programming language often used to build websites and software,
automate tasks, and conduct data analysis. Python is a general-purpose language, meaning it
can be used to create a variety of different programs and isn’t specialized for any specific
problems. This versatility, along with its beginner-friendliness, has made it one of the most-
used programming languages today. A survey conducted by industry analyst firm Red Monk
found that it was the second-most popular programming language among developers in 2021.

Python is commonly used for developing websites and software, task automation, data
analysis, and data visualization. Since it’s relatively easy to learn, Python has been adopted by
many non-programmers such as accountants and scientists, for a variety of everyday tasks, like
organizing finances.

Python has become a staple in data science, allowing data analyst and other


professionals to use the language to conduct complex statistical calculations, create data
visualizations, build machine learning algorithms, manipulate and analyse data, and complete
other data-related tasks.

Python can build a wide range of different data visualizations, like line and bar graphs,
pie charts, histograms, and 3D plots. Python also has a number of libraries that enable coders to
write programs for data analysis and machine learning more quickly and efficiently, like
TensorFlow and Kera’s.

Python is often used to develop the back end of a website or application—the parts that
a user doesn’t see. Python’s role in web development can include sending data to and from
servers, processing data and communicating with databases, URL routing, and ensuring
security. Python offers several frameworks for web development. Commonly used ones include
Django and Flask.

12
The various python compilers are:
1. Programiz
2. PyDev
3. PyCharm
4. Sublime Text
5. Thonny
6. Visual Studio Code
7. Jupyter Notebook
8. Vim
9. Atom
10. Spyder
11. IDLE
12. Eric
13. GNU/Emacs

PYCHARM

PyCharm IDE is primarily used in web and application development using Python. It
helps programmers develop applications efficiently in less time. Some of the common
benefits of using it are:

 Auto-completion of code
 Excellent debugging
 Project navigation
 Database tools

FEATURES OF PYCHARM
Inline Debugger

Inline debugger, all live debugging data are shown directly in the editor, with variable
values integrated into the editor's look-and-feel. Variable values can be viewed in the source
code, right next to their usages.

Multi-process debugging

PyCharm can debug applications that spawn multiple Python processes, such as
Django applications that don't run in --no-reload mode, or applications using many other Web
frameworks that use a similar approach to code auto-reloading.

13
Run in Any Python Environment

 You can run any Python file. Just right-click what you need to run and select 'Run <your
script>'.
 PyCharm allows easily configure the required Python environment for your project, be it
local, remote interpreter or a virulent.

Built-in Terminal

This is what makes PyCharm a complete Python IDE. No need to leave the IDE as
you develop. Local terminal is available for Windows, Linux and macOS.

FEATURES OF PYTHON

1. Easy to Code

Python is a very high-level programming language, yet it is effortless to learn.


Anyone can learn to code in Python in just a few hours or a few days. Mastering Python and
all its advanced concepts, packages and modules might take some more time. However,
learning the basic Python syntax is very easy, as compared to other popular languages like C,
C++, and Java. 

2. Easy to Read

Python code looks like simple English words. There is no use of semicolons or
brackets, and the indentations define the code block. You can tell what the code is supposed
to do simply by looking at it. 

14
3. Free and Open-Source

Python is developed under an OSI-approved open-source license. Hence, it is


completely free to use, even for commercial purposes. It doesn't cost anything to download
Python or to include it in your application. It can also be freely modified and re-distributed.
Python can be downloaded from the official Python website.

4. Robust Standard Library

Python has an extensive standard library available for anyone to use. This means that
programmers don’t have to write their code for every single thing unlike other programming
languages. There are libraries for image manipulation, databases, unit-testing, expressions
and a lot of other functionalities. In addition to the standard library, there is also a growing
collection of thousands of components, which are all available in the python package index.

5. Interpreted

When a programming language is interpreted, it means that the source code is


executed line by line, and not all at once. Programming languages such as C++ or Java are
not interpreted, and hence need to be compiled first to run them. There is no need to compile
Python because it is processed at runtime by the interpreter. 

6. Portable

Python is portable in the sense that the same code can be used on different machines.
Suppose you write a Python code on a Mac. If you want to run it on Windows or Linux later,
you don’t have to make any changes to it. As such, there is no need to write a program
multiple times for several platforms.

15
7. Object-Oriented and Procedure-Oriented

A programming language is object-oriented if it focuses design around data and


objects, rather than functions and logic. On the contrary, a programming language is
procedure-oriented if it focuses more on functions (code that can be reused). One of the
critical Python features is that it supports both object-oriented and procedure-oriented
programming. 

8. Extensible

A programming language is said to be extensible if it can be extended to other


languages. Python code can also be written in other languages like C++, making it a highly
extensible language.

9. Expressive

Python needs to use only a few lines of code to perform complex tasks. For example,
to display Hello World, you simply need to type one line - print (“Hello World”). Other
languages like Java or C would take up multiple lines to execute this.

10. Support for GUI

One of the key aspects of any programming language is support for GUI or Graphical
User Interface. A user can easily interact with the software using a GUI. Python offers
various toolkits, such as Tkinter, wxPython and JPython, which allows for GUI's easy and
fast development.

11. Dynamically Typed

Many programming languages need to declare the type of the variable before runtime.
With Python, the type of the variable can be decided during runtime. This makes Python a
dynamically typed language.

16
For example, if you have to assign an integer value 20 to a variable “x”, you don’t
need to write int x = 20. You just have to write x = 15.

12. High-level Language

Python is a high-level programming language because programmers don’t need to


remember the system architecture, nor do they have to manage the memory. This makes it
super programmer-friendly and is one of the key features of Python.

13. Simplify Complex Software Development

Python can be used to develop both desktop and web apps and complex scientific and
numerical applications. Python's data analysis features help you create custom big data
solutions without so much time and effort. You can also use the Python data visualization
libraries and APIs to present data in a more appealing way. Several advanced software
developers use Python to accomplish high-end AI and natural language processing tasks. 

14. Other Advanced Programming Features

Python contains several advanced programming features such as generators (used to


create iterators with a different approach that most other languages) and list comprehensions
(used to create new lists from other iterables). Python also has automatic memory
management eliminating the need to manually allocate and free memory in the code.

17
2. SYSTEM STUDY

2.1 EXISTING SYSTEM

The term A.I assistant or virtual assistant, is also commonly used to describe contract
workers who work from home doing administrative tasks typically performed by executive
assistants or secretaries. A.I assistants are typically cloud-based programs that require
internet-connected devices and/or applications to work. Three such applications are Siri on
Apple devices, Cortana on Microsoft Devices and Google Assistant on Android devices.
There are also devices dedicated to providing virtual assistance. The most popular ones are
available from Amazon, Google and Microsoft. To use the Amazon Echo virtual assistant,
called Alexa, users call out the wake word, "Alexa." A light on the device signals to the user
it is ready to receive a command, which typically involves simple language requests, such as
"what is the weather today," or "play pop music." Those requests are processed and stored in
Amazon's cloud. The technologies that power virtual assistants require massive amounts of
data, which feeds artificial intelligence (AI) platforms, including machine learning, natural
language processing and speech recognition platforms. As the end user interacts with a virtual
assistant, the AI programming uses sophisticated algorithms to learn from data input and
become better at predicting the end user's needs.

18
2.1.1 DRAWBACKS

A.I assistants have a variety of privacy concerns associated with them. Features such
as activation by voice pose a threat; as such features require the device to always be listening.
However, such features are important to make devices accessible for people who may
otherwise have trouble. Modes of privacy such as the virtual security button have been
proposed to create a multilayer authentication for A.I assistants.

Cortana, for example, works best by using data from a user's device, including emails
and other communications, a user's contacts, location data, search history, and data from
other Microsoft services and skills -- third-party applications -- that users choose to connect
with. Users can choose not to sign in and share this data with Cortana, and adjust permissions
to prevent certain data from being collected, though these actions limit the virtual assistant's
usefulness. These virtual assistants require large amounts of personal data and are always
"listening" in order to respond to voice commands. Virtual assistants then retain voice
interactions and personal information to improve the user experience. Virtual assistant
providers also maintain privacy policies, which define how each company uses and shares
personal information. In most cases, companies do not share customer-identifiable
information without a customer's consent.

2.2 PROPOSED SYSTEM

To design a device that acts as a digital organizer to provide variety of services to its
master. It will look at examples of intelligent programs with natural language processing that
are currently available, with different categories of support, and examine the potential
usefulness of one specific piece of software as a VPA. It continues to expand its digital
abilities in organizing events, ordering food, playing music, guiding services for travelling,
say’s jokes etc. It is suggested that new technologies may soon make the idea of virtual
personal assistants a reality. Experiments conducted on this system, combined with user

19
testing, have provided evidence that a basic program with machine learning algorithms in the
form of a digital personal assistant. Using machine learning algorithms to iteratively learn
user’s preference for each theme based on quality feedback given by the user. The concept of
a virtual assistant which is a digital service looking after a range of our needs is fast
becoming a reality. As artificial intelligence and machine learning progress at pace, digital
assistants are set to become our gateway to the internet and know more about us than we do
ourselves. Siri and Google now are just the beginning. The device accepts voice input
processes it through various machine learning algorithms to provide desired output to user.

2.2.1 FEATURES

Virtual assistants typically perform simple jobs for end users, including the following:

 providing information that would normally be searched in a web browser;

 controlling cameras;

 creating text notes;

 hearing news and weather reports;

 finding hotels or restaurants;

 listening to music;

 open YouTube and chrome;

 Intimate alert while attempting suicide;

 Say’s joke;

20
3.SYSTEM DESIGN AND DEVELOPMENT

The design of the system is essentially a blue print or plan for solution of the system
to be developed. A part of the system or subsystem of a whole system can itself be considered
a system with its own complements

3.1 FILE DESIGN

The file design is the last phase that indicates the final system and process of the final
system in the design phase of A.I ASSISTANT, input screen design and output design etc are
designed

All the input screens in this system are user-friendly and understandable format.

Also, the sizes of all the screens are standardized

The importance of software design can be stated with a single word "QUALITY":
Design is a place where quality is fostered in software development. Design is the only way
where their requirements are accurately translated into finished software product or system.

3.2 INPUT DESIGN

Input design is the process of converting user-originated inputs to a computer-based


format

The system takes input from the users, processes it and produces an output. Input
design is link that ties the information system into the world of its users. The system should
be users friendly to gain appropriate information to the user

21
3.3 OUTPUT DESIGN

Output design generally refers to the results and information that are integrated by the
system for many end users. Output is the main reason for developing the system and the basis
on which they evaluate the usefulness of the application.

The objective of a system finds its shape in terms of output, Output of a system can
face various forms. The most command are the reports, screen displays, printed forms,
graphical, drawings etc. The basic requirements of output are that, it should be accurate,
timely and of content, medium and layout for its in tented purpose.

External outputs are those whose destination will be outside the organization
Interactive outputs are those, in which user uses in communicating directly with computer

3.4 DATABASE DESIGN

The Database Management System (DBMS) consists of a collection of Interrelated


data and a set of programs to access that data. The collection of data usually referred to as
database. The primary key goal of DBMS is to provide an environment that is both
convenient and efficient to use in retrieving and storing data information.

The term database design can be used to describe many different parts of the design of
an overall database system. Principally and most correctly, it can be thought of as the logical
design of the base data structures used to store the data. In the relational model these are the
tables and views. In an object database the entities and relationships map directly to object

22
classes and named relationships. However, the term database design could also be used to
apply to the overall process of designing, not just the base data structures, but also the forms
and queries used as part of the overall database application within the database management
system (DBMS)

The process of doing database design generally consists of a number of steps which
will be carried out by the database designer.

3.5 SYSTEM DEVELOPMENT

A system development project encompasses all the activities undertaken from the
time at which a potential requirement is identified until the resulting system is fully
implemented and accepted by the end user. The process can involve many stages over a long
period. The following section highlights some fundamental issues to be considered. outlines
the main stages in development and procuring new systems, and indicates when and how the
auditor should be involved.

An information system acquired today must not only satisfy present business needs, it
must also be flexible and capable of being enhanced to meet changing circumstances well
into the future. Thus, a pre-requisite to the introduction of a new system is for management to
identify and understand their organization's mission and its related information needs.
Writing this down helps to ensure common understanding and direction, and provides a
yardstick against which achievement can be measured.

3.5.1 Methodology of A.I

Speech Recognition module

The system uses Google’s online speech recognition system for converting speech
input to text. The speech input Users can obtain texts from the special corpora organized on
the computer network server at the information centre from the microphone is temporarily

23
stored in the system which is then sent to Google cloud for speech recognition. The
equivalent text is then received and fed to the central processor.

API calls

API stands for Application Programming Interface. An API is a software intermediary


that allows two applications to talk to each other. In other words, an API is a messenger that
delivers your request to the provider that you’re requesting it from and then delivers the
response back to you.

Content Extraction

Context extraction (CE) is the task of automatically extracting structured information


from unstructured and/or semi-structured machine-readable documents. In most cases, this
activity concerns processing human language texts using natural language processing (NLP).
Recent activities in multimedia document processing like automatic annotation and content
extraction out of images/audio/video could be seen as context extraction TEST RESULTS.

Text-to-speech module

Text-to-Speech (TTS) refers to the ability of computers to read text aloud. A TTS
Engine converts written text to a phonemic representation, then converts the phonemic
representation to waveforms that can be output as sound. TTS engines with different
languages, dialects and specialized vocabularies are available through third-party publishers.

24
4.TESTING AND IMPLEMENTATION

SYSTEM TESTING

Artificial intelligence (AI) has blessed several industries with its efficiency and
accuracy. Businesses are leveraging AI to deliver flawless customer experience at a fraction
of the costs that they used to spend before. Virtual assistants (VA) are helping businesses to
automate customer support and engagement round the clock without any human intervention.
AI-powered solutions have become increasingly popular among both startups and global
enterprises to interact with customers at scale.

Key metrics to test virtual assistants 

It is essential to keep in mind the below mentioned key metrics when testing virtual
assistants: 

1. Response time: 

Normally, AI-enabled virtual assistants are expected to reply instantly after an input is
received from the user. Any lag in response can affect the user experience. Hence, it is
business-critical to test the exact response time of the VA to ensure a customer delight
experience. 

2. Answering/Response accuracy: 

Test the responses or answers by VAs to inputs or queries to ensure they are meeting
the business objective efficiently. 

25
3. Error management: 

AI-enabled VA is equipped to handle errors and address them. For instance, if a


virtual assistant is unable to process user inputs, it should be able to think alternately and ask
different questions from the user to eliminate dead air in the conversation. In worst case
scenario, it should transfer the call to a live agent. 

4. Personality: 

Virtual assistants should have a unique tone that is pleasant for users. To ensure a
great customer experience, its tone should be tested and rectified if needed. 

5. Navigation: 
Customers often feel lost while communicating with a virtual assistant. Make sure the
navigation of the VA is user-friendly for a seamless experience. 

26
5.CONCLUSION

In this paper “Virtual Assistant Using Python” we discussed the design and
implementation of Digital Assistance. The project is built using open-source software
modules with PyCharm community backing which can accommodate any updates shortly.
The modular nature of this project makes it more flexible and easier to add additional features
without disturbing current system functionalities.

It not only works on human commands but also give responses to the user based on
the query being asked or the words spoken by the user such as opening tasks and operations.
It is greeting the user the way the user feels more comfortable and feels free to interact with
the voice assistant. The application should also eliminate any kind of unnecessary manual
work required in the user life of performing every task. The entire system works on the verbal
input rather than the next one.

27
28
BIBLIOGRAPHY

Books References
1. Adriana Stan Beata Lorincz,” GENERATING THE VOICE OF THE INTERACTIVE
VIRTUAL ASSISTANT”, Feb 10th 2021
2. Ali soofastaei,” VIRTUAL ASSISTANT”, Artificial Intelligence Center, Australia,2021

WEBSITES
1. http://www.github.com/
2. http://www.projectworld.com/
3. http://www.greeks for greeks.com/

29
APPENDICES

A) DATA FLOW DIAGRAM

LEVEL 0

Voice Identify word


Input & phrases

User Google speech


BRAIN Recognition

Response Machine
Face Recognition readable
format
Voice to text
Action performer

LEVEL 1

User
Weather BRAIN
Voice API
input Google
API
Response

Wiki API

Action completed

30
B) SAMPLE CODING

import subprocess

import wolframalpha

import pyttsx3

import json

import speech_recognition as sr

import datetime

import wikipedia

import webbrowser

import os

import winshell

import pyjokes

import smtplib

import ctypes

import time

import requests

import shutil

31
from twilio.rest import Client

from clint.textui import progress

from ecapture import ecapture as ec

from urllib.request import urlopen

engine = pyttsx3.init('sapi5')

voices = engine.getProperty('voices')

engine.setProperty('voice', voices[1].id)

def speak(audio):

engine.say(audio)

engine.runAndWait()

def wishMe():

hour = int(datetime.datetime.now().hour)

if hour >= 0 and hour < 12:

speak("Good Morning Sir !")

elif hour >= 12 and hour < 18:

speak("Good Afternoon Sir !")

else:
32
speak("Good Evening Sir !")

assname = ("pixie")

speak("thats my name bro")

speak(assname)

def username():

speak("What your name")

uname = takeCommand()

speak("Welcome ")

speak(uname)

columns = shutil.get_terminal_size().columns

print("#####################".center(columns))

print("Mr.", uname.center(columns))

print("#####################".center(columns))

speak("How can i Help you, Sir")

def takeCommand():

r = sr.Recognizer()

with sr.Microphone() as source:

print("Listening...")
33
r.pause_threshold = 1

audio = r.listen(source)

try:

print("Recognizing...")

query = r.recognize_google(audio, language='en-in')

print(f"User said: {query}\n")

except Exception as e:

print(e)

print("Unable to Recognize your voice.")

return "None"

return query

def sendEmail(to, content):

server = smtplib.SMTP('smtp.gmail.com', 587)

server.ehlo()

server.starttls()

# Enable low security in gmail

server.login('your email id', 'your email password')

server.sendmail('your email id', to, content)


34
server.close()

if __name__ == '__main__':

clear = lambda: os.system('cls')

# This Function will clean any

# command before execution of this python file

clear()

wishMe()

username()

while True:

query = takeCommand().lower()

# All the commands said by user will be

# stored here in 'query' and will be

# converted to lower case for easily

# recognition of command

if 'wikipedia' in query:

speak('Searching Wikipedia...')

query = query.replace("wikipedia", "")


35
results = wikipedia.summary(query, sentences=3)

speak("According to Wikipedia")

print(results)

speak(results)

elif 'open youtube' in query:

speak("Here you go to Youtube\n")

webbrowser.open("youtube.com")

elif 'open google' in query:

speak("Here you go to Google\n")

webbrowser.open("google.com")

elif 'open stackoverflow' in query:

speak("Here you go to Stack Over flow.Happy coding")

webbrowser.open("stackoverflow.com")

elif 'play music' in query or "play song" in query:

speak("Here you go with music")

# music_dir = "G:\\Song"

music_dir = "C:\\Users\\GAURAV\\Music"
36
songs = os.listdir(music_dir)

print(songs)

random = os.startfile(os.path.join(music_dir, songs[1]))

elif 'the time' in query:

strTime = datetime.datetime.now().strftime("% H:% M:% S")

speak(f"Sir, the time is {strTime}")

elif 'open opera' in query:

codePath = r"C:\\Users\\GAURAV\\AppData\\Local\\Programs\\Opera\\launcher.exe"

os.startfile(codePath)

elif 'email to gaurav' in query:

try:

speak("What should I say?")

content = takeCommand()

to = "Receiver email address"

sendEmail(to, content)

speak("Email has been sent !")

except Exception as e:

print(e)
37
speak("I am not able to send this email")

elif 'send a mail' in query:

try:

speak("What should I say?")

content = takeCommand()

speak("whome should i send")

to = input()

sendEmail(to, content)

speak("Email has been sent !")

except Exception as e:

print(e)

speak("I am not able to send this email")

elif 'how are you' in query:

speak("I am fine, Thank you")

speak("How are you, Sir")

elif 'fine' in query or "good" in query:

speak("It's good to know that your fine")


38
elif "change my name to" in query:

query = query.replace("change my name to", "")

assname = query

elif "change name" in query:

speak("What would you like to call me, Sir ")

assname = takeCommand()

speak("Thanks for naming me")

elif "what's your name" in query or "What is your name" in query:

speak("people call me")

speak(assname)

print("people call me", assname)

elif 'exit' in query:

speak("Thanks for giving me your time")

exit()

elif "who made you" in query or "who created you" in query:

speak("I have been created by bittu.")

elif 'say me a joke' in query:


39
speak(pyjokes.get_joke())

elif 'say me another joke' in query:

speak(pyjokes.get_joke())

elif "calculate" in query:

app_id = "Wolframalpha api id"

client = wolframalpha.Client(app_id)

indx = query.lower().split().index('calculate')

query = query.split()[indx + 1:]

res = client.query(' '.join(query))

answer = next(res.results).text

print("The answer is " + answer)

speak("The answer is " + answer)

elif 'search' in query or 'play' in query:

query = query.replace("search", "")

query = query.replace("play", "")

webbrowser.open(query)

elif "who i am" in query:

speak("If i am not blind , i think you are a human , are you?.")


40
elif "yes i am human" in query:

speak("Then why did even ask that question , are you dumb or what?.")

elif "how did you came to world" in query:

speak("Thanks to bittu. further It's a secret")

elif 'power point presentation' in query:

speak("opening Power Point presentation")

power = r"C:\\Users\\GAURAV\\Desktop\\Minor Project\\Presentation\\Voice


Assistant.pptx"

os.startfile(power)

elif 'is love' in query:

speak("It is 7th sense that destroy all other senses and i hope master dont get fool by
love")

elif "who are you" in query:

speak("I am your virtual assistant created by bittu")

elif 'reason for you' in query:

speak("I was created as a Minor project by Mister bittu ")

elif 'change background' in query:

ctypes.windll.user32.SystemParametersInfoW(20,

41
0,

"Location of wallpaper",

0)

speak("Background changed successfully")

elif 'open bluestack' in query:

appli = r"C:\\ProgramData\\BlueStacks\\Client\\Bluestacks.exe"

os.startfile(appli)

elif 'news' in query:

try:

jsonObj = urlopen(

'''https://newsapi.org / v1 / articles?source = the-times-of-india&sortBy =


top&apiKey =\\times of India Api key\\''')

data = json.load(jsonObj)

i=1

speak('here are some top news from the times of india')

print('''=============== TIMES OF INDIA ============''' + '\n')

for item in data['articles']:

print(str(i) + '. ' + item['title'] + '\n')

42
print(item['description'] + '\n')

speak(str(i) + '. ' + item['title'] + '\n')

i += 1

except Exception as e:

print(str(e))

elif 'lock window' in query:

speak("locking the device")

ctypes.windll.user32.LockWorkStation()

elif 'shutdown system' in query:

speak("Hold On a Sec ! Your system is on its way to shut down")

subprocess.call('shutdown / p /f')

elif 'empty recycle bin' in query:

winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=True)

speak("Recycle Bin Recycled")

elif "don't listen" in query or "stop listening" in query:

speak("for how much time you want to stop jarvis from listening commands")

a = int(takeCommand())

time.sleep(a)
43
print(a)

elif "where is" in query:

query = query.replace("where is", "")

location = query

speak("User asked to Locate")

speak(location)

webbrowser.open("https://www.google.com / maps / place/" + location + "")

elif "camera" in query or "take a photo" in query:

ec.capture(0, "Jarvis Camera ", "img.jpg")

elif "restart" in query:

subprocess.call(["shutdown", "/r"])

elif "hibernate" in query or "sleep" in query:

speak("Hibernating")

subprocess.call("shutdown / h")

elif "log off" in query or "sign out" in query:

speak("Make sure all the application are closed before sign-out")

time.sleep(5)

subprocess.call(["shutdown", "/l"])
44
elif "write a note" in query:

speak("What should i write, sir")

note = takeCommand()

file = open('pixie.txt', 'w')

speak("Sir, Should i include date and time")

snfm = takeCommand()

if 'yes' in snfm or 'sure' in snfm:

strTime = datetime.datetime.now().strftime("% H:% M:% S")

file.write(strTime)

file.write(" :- ")

file.write(note)

else:

file.write(note)

elif "show note" in query:

speak("Showing Notes")

file = open("pixie.txt", "r")

print(file.read())

speak(file.read(6))
45
elif "update assistant" in query:

speak("After downloading file please replace this file with the downloaded one")

url = '# url after uploading file'

r = requests.get(url, stream=True)

with open("Voice.py", "wb") as Pypdf:

total_length = int(r.headers.get('content-length'))

for ch in progress.bar(r.iter_content(chunk_size=2391975),

expected_size=(total_length / 1024) + 1):

if ch:

Pypdf.write(ch)

# NPPR9-FWDCX-D2C8J-H872K-2YT43

elif "pixie" in query:

wishMe()

speak("pixie 1 point o in your service Mister")

speak(assname)

elif "weather" in query:

# Google Open weather website

# to get API of Open weather


46
api_key = "Api key"

base_url = "http://api.openweathermap.org / data / 2.5 / weather?"

speak(" City name ")

print("City name : ")

city_name = takeCommand()

complete_url = base_url + "appid =" + api_key + "&q =" + city_name

response = requests.get(complete_url)

x = response.json()

if x["code"] != "404":

y = x["main"]

current_temperature = y["temp"]

current_pressure = y["pressure"]

current_humidiy = y["humidity"]

z = x["weather"]

weather_description = z[0]["description"]

print(" Temperature (in kelvin unit) = " + str(

current_temperature) + "\n atmospheric pressure (in hPa unit) =" + str(

current_pressure) + "\n humidity (in percentage) = " + str(


47
current_humidiy) + "\n description = " + str(weather_description))

else:

speak(" City Not Found ")

elif "send message " in query:

# You need to create an account on Twilio to use this service

account_sid = 'Account Sid key'

auth_token = 'Auth token'

client = Client(account_sid, auth_token)

message = client.messages \

.create(

body=takeCommand(),

from_='Sender No',

to='Receiver No'

print(message.sid)

elif "wikipedia" in query:

webbrowser.open("wikipedia.com")

elif "Good Morning" in query:


48
speak("A warm" + query)

speak("How are you Mister")

speak(assname)

# most asked question from google Assistant

elif "will you be my gf" in query or "will you be my bf" in query:

speak("no i m fine, just ask a real girl dude and stop simping at an a i")

elif "how are you" in query:

speak("I'm fine, glad you me that")

elif "i love you" in query:

speak("please go out and find a real girl")

elif "what is" in query or "who is" in query:

# Use the same API key

# that we have generated earlier

client = wolframalpha.Client("API_ID")

res = client.query(query)

try:

print(next(res.results).text)

speak(next(res.results).text)
49
except StopIteration:

print("No results")

# elif "" in query:

# Command go here

# For adding more commands

50
C) SAMPLE INPUT

51
52
53
D) SAMPLE OUTPUT

54
55

You might also like