Virtual Assistant Project - REPORT
Virtual Assistant Project - REPORT
A PROJECT REPORT
Submitted by
MATHIVANAN M KISHORE B
513418104020 513418104016
BACHELOR OF ENGINEERING IN
COMPUTER SCIENCE & ENGINEERING
SIGNATURE SIGNATURE
The project aims to develop a personal virtual assistant for windows based system.
Jarvis draws its inspiration from virtual assistants like Cortana for Windows, and Siri
for iOS. It has been designed to provide a user-friendly interface for carrying out a
variety of tasks by employing certain well-defined commands. Users can interact with
the assistant either through voice commands or using keyboard input. As a personal
assistant, Jarvis assists the end-user with day-to-day activities like general human
conversation, searching queries in google or yahoo, searching for videos, playing
songs, live weather conditions, word meanings, searching for medicine details and
reminding the user about the scheduled events and tasks. The virtual assistant takes
the voice input through our microphone and it converts our voice into computer
understandable language and gives the required solutions and answers which are
asked by the user. This assistant connects with the world wide web to provide results
that the user has questioned. This project works on voice input and gives output
through voice and displays the text on the screen. The main agenda of our virtual
assistant is that it makes people smart and give instant and computed results.
TABLE OF CONTENTS
CHAPTER TITLE PAGE
NO NO
ABSTRACT
LIST OF FIGURES
LIST OF ABBREVATIONS
1 INTRODUCTION
2 PRELIMINARIES
3 LITERATURE SURVEY
4 SYSTEM SPECIFICATIONS
5 SYSTEM DESIGN
6.1 MODULES
6.2 MODULE DESCRIPTION
7 SYSTEM STUDY
8 SYSTEM TESTING
8.1 TESTING
8.2 TYPES OF TESTING UNIT TESTING
8.2.1 UNIT TESTING
8.2.2 INTEGRATION TESTING
8.2.3 FUNCTIONAL TESTING
8.2.4 SYSTEM TESTING
8.2.5 WHITE BOX TESTING
8.2.6 BLACK BOX TESTING
8.3 TEST RESULTS
9.1 CONCLUSION
9.2 FUTURE WORK
APPENDIX – 1 SOURCE CODE
APPENDIX – II SNAPSHOTS
10 REFERENCES
LIST OF FIGURES
ACRONYM ABBREVATIONS
A Virtual Assistant is the software that can perform task and provide different
services to the individual as per the individual’s dictated commands. This is done
through a synchronous process involving recognition of speech patterns and then,
responding via synthetic speech. Through these assistants a user can automate
tasks ranging from but not limited to mailing, tasks management and media
playback. It understands natural language voice commands and complete the tasks
for the user. It is typically a cloud-based program that requires internet connected
devices and/or applications to work. The technologies that power virtual assistants
are machine learning, natural language processing and speech recognition
platforms. It uses sophisticated algorithms to learn from data input and become
better at predicting the end user's needs.
1.2 MOTIVATION
The main purpose of this project is to build a program that will be able to service
to humans like a personal assistant. This is an interesting concept and many people
around the globe are working it. Today, time and security are the two main things to
which people are more sensitive, no one has the time to spoil; nobody would like their
security breach, and this project is mainly for those kinds of people.
1.4 APPLICABILITY
The mass adoption of artificial intelligence in users’ everyday lives is also fuelling the
shift towards voice. The number of IoT devices such as smart thermostats and
speakers are giving voice assistants more utility in a connected user’s life. Smart
speakers are the number one way we are seeing voice being used.
Many industry experts even predict that nearly every application will integrate voice
technology in some way in the next 5 years. The use of virtual assistants can also
enhance the system of IoT (Internet of Things). Twenty years from now, Microsoft
and its competitors will be offering personal digital assistants that will offer the
services of a full-time employee usually reserved for the rich and famous.
CHAPTER 2
PRELIMINARIES
This project describes one of the most efficient ways for voice recognition. It
overcomes many of the drawbacks in the existing solutions to make the Virtual
Assistant more efficient. It uses natural language processing to carry out the specified
tasks. It has various functionalities like network connection and managing activities
by just voice commands. It reduces the utilization of input devices like keyboard.
This project describes the method to implement a virtual assistant for desktop using
the APIs. In this module, the voice commands are converted to text through Google
Speech API. Text input is just stored in the database for further process. It is
recognized and matched with the commands available in database. Once the command
is found, its respective task is executed as voice, text or through user interface as
output.
2.1.1 DISADVANTAGES
They propose a new detection scheme that gets two similar results which could
cause confusions to the user on deciding the actual/desired output.
Though the efficiency is high of the proposed module, the time consumption
for each task to complete is higher and also the complexity of the algorithms
would make it very tough to tweak it if needed in the future.
2. ACCESSING NEWS:
Being up-to-date in this modern world is very much important. In that way news plays
a big crucial role in keeping ourselves updated. News keeps you informed and also
helps in spreading knowledge.
2.2.1 ADVANTAGES
Platform independence
Increased flexibility
Saves time by automating repetitive tasks
Accessibility options for Mobility and the visually impaired
Reducing our dependence on screens
Adding personality to our daily lives
More human touch
Coordination of IoT devices
Accessible and inclusive
Aids hands free operation
CHAPTER 3
LITERATURE SURVEY
3.1 “VOICE ASSISTANT USING PYTHON”
YEAR: 2020
AUTHORS: Subhash Mani Kaushal, Megha Mishra
CONCEPT: Natural Language Processing.
CHAPTER 4
SYSTEM SPECIFICATIONS
4.1 HARDWARE REQUIREMENTS
CHAPTER 5
SYSTEM DESIGN
5.1 ARCHITECTURE DIAGRAM
ADVANTAGES
The below 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.
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.
CHAPTER 6
SYSTEM IMPLEMENTATION
6.1 MODULES
Pyttsx3
Sapi5
Speech recognition
Pyaudio
Wikipedia
Webbrowser
6.2.4 Pyaudio
6.2.5 Wikipedia
Wikipedia is a Python library that makes it easy to access and parse data from
Wikipedia. It gets article summaries, get data like links and images from a page, and
more. This module provides developers code-level access to the entire Wikipedia
reference.
6.2.6 Webbrowser
CHAPTER 7
SYSTEM STUDY
7.1 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 of the proposed system.
Three key considerations involved in the feasibility analysis are:
Economical feasibility
Technical feasibility
Social feasibility
The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The user
must not feel threatened by the system, instead must accept it as a necessity.
The level of acceptance by the users solely depends on the methods that are employed
to educate the user about the system and to make him familiar with it. His level of
confidence must be raised so that he is also able to make some constructive criticism,
which is welcomed, as he is the final user of the system.
CHAPTER 8
SYSTEM TESTING
8.1 TESTING
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way to
check the functionality of components, sub – assemblies, assemblies and/or a finished
product It is the process of exercising software with the intent of ensuring that the
Software system meets its requirements and user expectations and does not fail in an
unacceptable manner. There are various types of tests. Each test type addresses a
specific testing requirement.
8. 3 TEST RESULTS
All the test cases mentioned above have passed successfully. No defects encountered.
CHAPTER 9
CONCLUSION AND FUTURE WORK
9.1 CONCLUSION
Through this virtual assistant, we have automated various services using a single
line command. It eases most of the tasks of the user like searching the web, playing
music and doing Wikipedia searches. We aim to make this project a complete server
assistant and make it smart enough to act as a replacement for a general server
administration. The project is built using available open-source software modules with
visual studio code community backing which can accommodate any updates in future.
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. The application
should also eliminate any kind of unnecessary manual work required in the user life of
performing every task.
APPENDIX – 1
SOURCE CODE
import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import datetime
import wikipedia #pip install wikipedia
import webbrowser
import os
import sys
import time
import smtplib
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', voices[0].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!")
elif hour>=12 and hour<18:
speak("Good Afternoon!")
else:
speak("Good Evening!")
speak("I am Jarvis Sir. Please tell me how may I help you")
def takeCommand():
#It takes microphone input from the user and returns string output
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
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("Say that again please...")
return "None"
return query
if __name__ == "__main__":
wishMe()
while True:
# if 1:
query = takeCommand().lower()
# Logic for executing tasks based on query
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)
elif 'open youtube' in query:
webbrowser.open("youtube.com")
elif 'open google' in query:
webbrowser.open("google.com")
elif 'open stackoverflow' in query:
webbrowser.open("stackoverflow.com")
elif 'news' in query:
webbrowser.open("bbc.com")
print("Here some headlines from the newspaper from BBC news, Happy
reading!")
speak("Here some headlines from the newspaper from BBC news, Happy
reading!")
elif 'play music' in query:
music_dir = "C:/Users/dgsou/Music/fav-music"
songs = os.listdir(music_dir)
print(songs)
os.startfile(os.path.join(music_dir, songs[0]))
elif 'the time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")
elif 'open code' in query:
codePath = "C:/Users/dgsou/AppData/Local/Programs/Microsoft VS Cod
e/Code.exe"
os.startfile(codePath)
elif 'goodbye' in query:
speak("Goodbye! Have a nice day")
print("Goodbye! Have a nice day")
time.sleep(2)
sys.exit()
APPENDIX – II
SNAPSHOTS
CHAPTER 10
REFERENCES
1. Abhay Dekate, Chaitanya Kulkarni, Rohan Killedar, “Study of Voice
Controlled Personal Assistant Device”, International Journal of Computer
Trends and Technology (IJCTT) – Volume 42 Number 1 – December 2016.