You are on page 1of 34

8

7
Imrie P,
Imrie P, and
and BednarBednar P. P. (2013).
(2013). ’Virtual Personal Assista
Martinez M. and Pennarolaecilia MARTHA (VIRTUAL F.ASSISTANT)
(editors). MARTHA ItAIS 2013. (VIRTUAL ASSISTANT)
Proceedings of 10th Conference
Italian Chapter ofof academic
AIS,requirements
’Empowering
Submitted in partial fulfillment of academic requirements for the award of the degree of
Submitted in partial fulfillment Bachelor for the award of the degree of
societyBachelorthrough digital innovations’, Università Comm
of Engineering (Computer Science and Engineering)
of Engineering (Computer Science and Engineering) Comm
Luigi Bocconi in Milan, Italy, December By
14th, 2013. ISBN: 978-88-6685-007-6 By
RAMA NAGARAJU
RAMA NAGARAJU
(including
Conclusion ongoing metadata creation and an
(2451-17-733-073)
(2451-17-733-073)
PINNELA SUHAN KUMAR
as
Thediscussed
results gathered in this paper from athe tests with Kari
PINNELA SUHAN KUMAR
(2451-17-733-078)
new
givenform
evidence of virtual assistant
(2451-17-733-078)
to support
MAHESH MAHESH ourcould be create
MAHESH MAHESH

virtual and personal


hypothesis. This wasassistant, (2451-17-733-079)
achieved by Kari show
(2451-17-733-079)

which is capable
capability to meetofthe emulating both logical an
emotional
requirements interest
discussed in the to support our initial
interaction
hypothesis.with its user, the
Throughout is a missing link in
business
conversations support with as Kariit falls duringwithin teststheoutputs
category
were appropriateof user support, and supporting the end
their needs to
contextual andtheefforts.
input. This contextual awar
Bringing
allowedDepartment
thethese programideas and
Department ofto
technologies
expand
Computer Science and Engineering
togeth
would lead
on the appropriate the way for a truly
of Computer Science and Engineering
M.V.S.R. ENGINEERING COLLEGEwith data that is re
answer
M.V.S.R. ENGINEERING COLLEGE

useful
to the subject personal
virtual
(Affiliated to Osmania the
University &now assistant.
Recognized by AICTE) Logical asp
(Affiliated to Osmania University & Recognized by AICTE)
by
Nadergul, SaroorNagar Mandal, Hyderabad – 501 510,
make
uniquethe
Nadergul,system Mandal,
metadata. SaroorNagar usable,
The end
Hyderabadhowever
– 501 510,
result of this is an
2018-19.
2018-19.
the combination
expanded response of logical
which in with turnemotional as
make such a system
goes beyond appropriate and becomes useful
worthwhile,
meaningful way and to so the ultimately
user. It is useful for the
this expansion that allows the trained instanc
Kari to function as a useful VPA
Department of Computer Science and Engineering
M.V.S.R. ENGINEERING COLLEGE
(Sponsored by Matrusri Education Society, Estd. 1980)
(Affiliated to Osmania University & Recognized by AICTE)
Nadergul, Saroor Nagar Mandal, Hyderabad – 501 510

CERTIFICATE

This is to certify that the project entitled “MARTHA”, is being submitted by Mr.
PINNELA SUHAN KUMAR bearing H.T.No: 2451-17-733-078 in partial fulfillment of
academic requirements for the award of the degree of BACHELOR OF ENGINEERING
in COMPUTER SCIENCE AND ENGINEERING from MVSR Engineering College,
affiliated to OSMANIA UNIVERSITY, is a record of bonafide work carried out by him
under the guidance and supervision of the faculty (CSED). The results embodied in this
project report have not been submitted to any other University or Institute for the award
of any degree or diploma to the best of my knowledge and belief.

GUIDE:
B.JANAIAH,
Assistant Professor,
Dept. of CSE
MVSR Engineering College
Department of Computer Science and Engineering
M.V.S.R. ENGINEERING COLLEGE
(Sponsored by Matrusri Education Society, Estd. 1980)
(Affiliated to Osmania University & Recognized by AICTE)
Nadergul, Saroor Nagar Mandal, Hyderabad – 501 510

CERTIFICATE
This is to certify that the project entitled “MARTHA”, is being submitted by Mr.
MASANAM MAHESH bearing H.T.No :2451-17-733-079 in partial fulfillment of
academic requirements for the award of the degree of BACHELOR OF ENGINEERING
in COMPUTER SCIENCE AND ENGINEERING from MVSR Engineering College,
affiliated to OSMANIA UNIVERSITY, is a record of bonafide work carried out by him
under the guidance and supervision of the faculty (CSED). The results embodied in this
project report have not been submitted to any other University or Institute for the award
of any degree or diploma to the best of my knowledge and belief.

GUIDE:
B JANAIAH,
Assistant Professor,
Dept. of CSE.
MVSR Engineering College
Department of Computer Science and Engineering
M.V.S.R. ENGINEERING COLLEGE
(Sponsored by Matrusri Education Society, Estd. 1980)
(Affiliated to Osmania University & Recognized by AICTE)
Nadergul, Saroor Nagar Mandal, Hyderabad – 501 510

CERTIFICATE
This is to certify that the project entitled “MARTHA”, is being submitted by Ms.
RAMA NAGARAJU bearing H.T.No: 2451-17-733-073 in partial fulfillment of
academic requirements for the award of the degree of BACHELOR OF ENGINEERING
in COMPUTER SCIENCE AND ENGINEERING from MVSR Engineering College,
affiliated to OSMANIA UNIVERSITY, is a record of bonafide work carried out by him
under the guidance and supervision of the faculty (CSED). The results embodied in this
project report have not been submitted to any other University or Institute for the award
of any degree or diploma to the best of my knowledge and belief.

GUIDE:
B JANAIAH,
Assistant Professor,
Dept. of CSE
MVSR Engineering College
ACKNOWLEDGMENT

I take this opportunity to express my profound and sincere gratitude to all those who
helped us in carrying out this project successfully.

At the very outset, I am thankful to our principal Sri Dr. G. Kanaka Durga and Sri
Dr.Akhil Khare, Professor and Head, Department of Computer Science and Engineering,
MVSR Engineering College, Hyderabad for their consent to do the project work as a part
of our B.E Degree (CSE). We thank them for their valuable suggestions and advice
throughout our stay at the college, during our project work.

I would like to thank our Internal Project Guide Mr. B.JANAIAH, Assistant Professor,
Department of Computer Science and Engineering, MVSR Engineering College for his
useful suggestions, guidance and encouragemet.

We thank the teaching and non-teaching staff of CSE for extending their support.

Finally we are thankful to our parents for their cooperation and support throughout all
endeavours in our life.

RAMA NAGARAJU (2451-17-733-073)

PINNELA SUHAN KUMAR(2451-17-733-078)

MASANAM MAHESH (2451-17-733-079)


ABSTRACT

MARTHA(VIRTUAL ASSISTANT)

Systems today are getting expert day by day and intend to help human in their
day to day queries.Today AI is present in a variety of fields ranging from industries in
manufacturing,to diagnosis in medicine technology,to customer care in public relations.

So here my team is going a head and creating virtual assistance named "martha"
for computer input it can perform tasks on a computer for an individual, By this we can
opearate with natural voice without the need for other type of human input .We are
constructing an executable file which runs on Windows platform and can do the works
we insits to computer with naturalvoice

TECHNOLOGIES USED:

Software:C Sharp(c#),Microsoft Visual Studio

APPLICATIONS AND USES:

The main aim of our project is to provide an easy voice controlable interface by
which the burden on the user decreases.Matha can perform tasks such as it can search
something for you online,plays you songs,open your files,set you remainders and
alarms,brings you online or offline by insist of your voice.

RAMA NAGARAJU - 2451-17-733-073

PINNELA SUHAN KUMAR -2451-17-733-078

MASANAM MAHESH - 2451-17-733-079

B.JANAIAH
(Asst. Prof)
CSED

MVSREC
Table Of Contents

Sl.No Chapter Pg.no.


List Of Figures

SNo DESCRIPTION PAGE NO


1 StairCase Parking 14
2 Blockage of Vehicles 14
3 Bar graph representing parking status at different times 16

4 Pie chart showing number of parking spaces operated by each 16


facility
5 Cars parked systematically in slots 18

6 Cars parked based on allotted slots 18

7 Flow Charts for existing solutions for parking lot management 23-24

8 Flow Chart for parking lot management 26

9 Parking status of 4 lots 36

10 Filling up fist parking lot 37

11 Leaving a vehicle from a random slot 37

12 Parking status of a particular slot 37

13 Parking availability status of a particular slot 38

14 Complete filling of the slots, thus making all the 4 parking lots 38
full

15 Availabilty status of 2nd slot 39

16 Availabilty status of 3rd slot 39


17 Availabilty status of 4th slot 40

Tables
INTRODUCTION

Problem Statement

Martha is your truly personal digital assistant working across al our windows
platform.Users can interact with martha with their natural voice giving as an input.martha
is an extended version cortana.Martha can answer you basic commands you insist to it.It
can open files for you if you insist with your natural voice as input.I has the ability to
convert the text to given to it into speech.It can read yout gmail and can give you updates
about it.
Nowadays people are busy with their lifes they need an virtual assistant to make their
lifes a bit easier.

versions : Martha almost supports every version of windows which has a capabitily of
speech recognition.At present martha is only available in english language.

What devices support Martha: All windows running platforms will support martha,the
device must have a microphone connected to it to take a voice as input.

How to enable martha: Martha is available in english you can enable martha by running
the martha applicaton.

"Hello Martha":Martha can be invoked hands free by saying "hello martha" and it can
be sent to rest by saying "goodbye" .

Martha Search :Martha has a ability to search for files and websites you insist with with
your voice input it can also run files like cmd etc with your voice commands.
Scope:
Objective
LITERATURE SURVEY:
IMPLEMENTATION

Source code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech.Synthesis;
using System.Speech;
using System.Speech.Recognition;
using System.IO;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Management;
using System.Net.NetworkInformation;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Net;
using System.Xml;
using System.Xml.Linq;
namespace Martha
{
public partial class Form1 : Form
{

SpeechRecognitionEngine Speechreco = new SpeechRecognitionEngine();


SpeechSynthesizer martha = new SpeechSynthesizer();
DateTime dateTime = DateTime.UtcNow.Date;
string[] files, paths;
public static List<string> MsgList = new List<string>();
public static List<string> MsgLink = new List<string>();
public static String QEvent;
int Emailnum = 0;
string username;
string password;
public Form1()
{
Speechreco.SpeechRecognized += new
EventHandler<SpeechRecognizedEventArgs>(Speechreco_SpeechRecognized);
LoadGrammer();
Speechreco.SetInputToDefaultAudioDevice();
Speechreco.RecognizeAsync(RecognizeMode.Multiple);
InitializeComponent();
}
private void LoadGrammer()
{

Choices texts = new Choices();


string[] lines = File.ReadAllLines(Environment.CurrentDirectory + "\\commands.txt");
texts.Add(lines);
Grammar Wordlist = new Grammar(new GrammarBuilder(texts));
Speechreco.LoadGrammar(Wordlist);

private void Speechreco_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)


{

string speech = e.Result.Text;


try
{
switch (speech)
{
///basic commands
case "hello":
case "hello martha":
case "martha hello":
martha.Speak("hello sir");
break;
case "how are you":
case "martha how are you":
case "how are you martha":
martha.Speak("Iam fine sir");
break;
case "what is your name":
martha.Speak("my name is martha iam an ai");
break;
case "what is your gender":
martha.Speak("i dont have a gender but my voice seems to be male");
break;
case "are you there":
case "martha are you there":
case "are you there martha":
martha.Speak("yes sir always ready");
break;
case "exit":
case "sleep":
case "goodbye":
case "goodbye martha":
case "martha goodbye":
case "martha bye":
martha.Speak("good bye sir have a nice day");
Application.Exit();
break;

///opening commands
case "open google":
case "martha open google":
case "open google martha":
martha.Speak("opening google");
martha.Speak("loading");
Process.Start("chrome.exe", "http://www.google.com");
break;
case "icognito":
case "martha turn icognito":
case "turn icognito":
SendKeys.Send("^+n");
break;
case "open youtube":
case "martha open youtube":
case "open youtube martha":
martha.Speak("opening youtube");
martha.Speak("loading sir");
Process.Start("chrome.exe", "http://www.youtube.com");
break;

case "open facebook":


case "martha open facebook":
case "open facebook martha":
martha.Speak("opening facebook");
martha.Speak("loading");
Process.Start("chrome.exe", "http://www.facebook.com");
break;
case "open instagram":
case "martha open instagram":
case "open instagram martha":
martha.Speak("opening instagram");
martha.Speak("loading sir");
Process.Start("chrome.exe", "http://www.instagram.com");
break;
case "open whatsapp":
case "martha open whatsapp":
case "open whatsapp martha":
martha.Speak("opening whatsapp");
martha.Speak("loading");
Process.Start("chrome.exe", "http://www.whatsapp.com");
break;
case "open amzon":
case "martha open amazon":
martha.Speak("opening amazon");
martha.Speak("loading");
martha.Speak("happy shoppoing sir");
Process.Start("chrome.exe", "http://www.amazon.in");
break;
case "open flipkart":
case "martha open flipkart":
martha.Speak("opening flipkart");
martha.Speak("loading");
martha.Speak("happy shopping sir");
Process.Start("chrome.exe", "http://www.flipkart.com");
break;
case "open notepad":
case "martha open notepad":
martha.Speak("opening notepad");
Process.Start("notepad.exe");
break;
case "open wordpad":
case "martha open wordpad":
martha.Speak("opening wordpad");
Process.Start("wordpad.exe");
break;
case "open cmd":
case "martha open commandpromt":
martha.Speak("opening commandpromt");
Process.Start("cmd.exe");
break;

///date and time


case "what time is it":
case "martha what is the time":
martha.Speak(DateTime.Now.ToString("h:mm:tt"));
break;
case "what is the date":
case "martha what is the date":
martha.Speak(DateTime.Now.ToString("MM/dd/yyyy"));
break;

///battery status

///cricket updates
case "get cricket updates":
martha.Speak("getting cricket updates");
Process.Start("chrome.exe",
"http://www.cricbuzz.com");
break;

///Media player commands


case "open playlist":
martha.Speak("opening playlist");
martha.Speak("sir please select songs");
Add_Music.PerformClick();
break;
case "play songs":
martha.Speak("playing songs");
PlayBtn.PerformClick();
break;
case "pause song":
martha.Speak("pausing the song");
PlayBtn.PerformClick();
break;
case "resume song":
martha.Speak("resuimg the song");
PlayBtn.PerformClick();
break;
case "stop song":
martha.Speak("stoping the song");
MediaStopBtn.PerformClick();
break;
case "play next song":
martha.Speak("playing next song");
NextBtn.PerformClick();
break;
case "play previous song":
martha.Speak("playing previous song");
PreviousBtn.PerformClick();
break;
case "forward song":
martha.Speak("forwarding the song");
FastForwardBtn.PerformClick();
break;
case "rewind song":
martha.Speak("rewinding the song");
FastRewindBtn.PerformClick();
break;
case "go fullscreen":
martha.Speak("going full screen");
Full_Screen.PerformClick();
break;

///text reader
case "open text files":
OpenBtn.PerformClick();
break;
case "read":
ReadBtn.PerformClick();
break;
case "pause":
PauseBtn.PerformClick();
break;
case "resume":
PauseBtn.PerformClick();
break;
case "stop":
martha.SpeakAsyncCancelAll();
break;

///Gmail Reader
case "get emails":
case "get all emails":
case "get all inbox emails":
GmailReaderBtn.PerformClick();
AllEmails();
break;
case "check for new emails":
username = textBox1.Text;
password = textBox2.Text;
QEvent = "Checkfornewemails";
martha.SpeakAsyncCancelAll();
Emailnum = 0;
CheckEmails();
break;
case "read email":
GmailReaderBtn.PerformClick();
martha.SpeakAsyncCancelAll();
try
{
martha.SpeakAsync(MsgList[Emailnum]);
}
catch
{
martha.SpeakAsync("there are no emails");
}
break;
case "next email":
GmailReaderBtn.PerformClick();
martha.SpeakAsyncCancelAll();
try
{
Emailnum += 1;
martha.SpeakAsync(MsgList[Emailnum]);
}
catch
{
Emailnum -= 1;
martha.SpeakAsync("there are no further emails");
}
break;
case "previous email":
GmailReaderBtn.PerformClick();
martha.SpeakAsyncCancelAll();
try
{
Emailnum -= 1;
martha.SpeakAsync(MsgList[Emailnum]);
}
catch
{
Emailnum += 1;
martha.SpeakAsync("there are no previous emails");
}
break;
case "stop reading gmails":
{
martha.SpeakAsyncCancelAll();
break;
}

///pronounciation
case "pronounce":
{
PronounceBtn.PerformClick();
break;
}

}
}
catch(Exception)
{
MessageBox.Show("MessageBox:martha is in pause state trun it to speaking state");
}
}
private void Form1_Load(object sender, EventArgs e)
{
Media_Player.uiMode = "none";
}

private void label1_Click(object sender, EventArgs e)


{

private void label3_Click(object sender, EventArgs e)


{

private void tabPage3_Click(object sender, EventArgs e)


{

private void button2_Click(object sender, EventArgs e)


{

if (Media_Player.settings.volume == 100)
{
Media_Player.settings.volume = 0;
Unmute_Volume.BackgroundImage = Properties.Resources.mute_speaker;
}
else
{
Media_Player.settings.volume = 100;
Unmute_Volume.BackgroundImage = Properties.Resources.speaker;
}

}
private void button8_Click(object sender, EventArgs e)
{

}
private void button10_Click(object sender, EventArgs e)
{

if (Media_Player.playState == WMPLib.WMPPlayState.wmppsPlaying)
{
if (PlayList.SelectedIndex > 0)
{
Media_Player.Ctlcontrols.previous();
PlayList.SelectedIndex -= 1;
PlayList.Update();
}
else
{
PlayList.SelectedIndex = 0;
PlayList.Update();
}
}

}
private void PlayBtn_Click(object sender, EventArgs e)
{

if (Media_Player.playState == WMPLib.WMPPlayState.wmppsPlaying)
{
PlayBtn.BackgroundImage = Properties.Resources.pause;
Media_Player.Ctlcontrols.pause();
}
else if (Media_Player.playState == WMPLib.WMPPlayState.wmppsPaused)
{
PlayBtn.BackgroundImage = Properties.Resources.play_button;
Media_Player.Ctlcontrols.play();
}
else if (PlayList.SelectedIndex > 0)
{
Media_Player.URL = paths[PlayList.SelectedIndex];
Media_Player.Ctlcontrols.play();
}
else
{
try
{
PlayList.SelectedIndex = 0;
Media_Player.Ctlcontrols.play();
}
catch(Exception)
{
martha.Speak("sir playlist is empty cannot play songs please select songs to play");
MessageBox.Show("MessageBox: playlist is empty please select songs from your drives");
}
}
}
private void MediaPauseBtn_Click(object sender, EventArgs e)
{

}
private void MediaStopBtn_Click(object sender, EventArgs e)
{
Media_Player.Ctlcontrols.stop();
}

private void NextBtn_Click(object sender, EventArgs e)


{

if (Media_Player.playState == WMPLib.WMPPlayState.wmppsPlaying)
{
if (PlayList.SelectedIndex < (PlayList.Items.Count - 1))
{
Media_Player.Ctlcontrols.next();
PlayList.SelectedIndex += 1;
PlayList.Update();
}
else
{
PlayList.SelectedIndex = 0;
PlayList.Update();
}
}

private void FastForwardBtn_Click(object sender, EventArgs e)


{
Media_Player.Ctlcontrols.fastForward();
}

private void FastRewindBtn_Click(object sender, EventArgs e)


{
Media_Player.Ctlcontrols.fastReverse();
}

private void Full_Screen_Click(object sender, EventArgs e)


{

if (Media_Player.playState == WMPLib.WMPPlayState.wmppsPlaying)
{
Media_Player.fullScreen = true;
}
else
{
Media_Player.fullScreen = false;
}

}
private void PlayBack_Timer_Tick(object sender, EventArgs e)
{

PlayBack_Timer.Start();
if (PlayList.SelectedIndex < files.Length - 1)
{
PlayList.SelectedIndex++;
PlayBack_Timer.Enabled = false;
}
else
{
PlayList.SelectedIndex = 0;
PlayBack_Timer.Enabled = false;
}
PlayBack_Timer.Stop();
}

private void PlayList_SelectedIndexChanged(object sender, EventArgs e)


{
Media_Player.URL = paths[PlayList.SelectedIndex];
}

private void trackBar1_Scroll(object sender, EventArgs e)


{
Media_Player.settings.volume = trackBar1.Value;
}
private void Add_Music_Click(object sender, EventArgs e)
{

string username = System.Environment.UserName;

OpenFileDialog ofd = new OpenFileDialog();


ofd.InitialDirectory = @"c:\Users\" + username + "\\D:\\music";
ofd.Filter =
"(mp3,wav,mp4,mov,mpg,avi,3gp,flv)|*.mp3;*.wav;*.mp4;*.3gp;*.avi;*.mov;*.flv;*.wmv;*.mpg|all
files|*.*";
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
files = ofd.SafeFileNames;
paths = ofd.FileNames;
for (int i = 0; i < files.Length; i++)
{
PlayList.Items.Add(files[i]);
}
}

private void ReadBtn_Click(object sender, EventArgs e)


{
StopBtn.PerformClick();
PlayBtn.Enabled = false;
PauseBtn.Enabled = true;
martha.SpeakAsync(Readtxt.Text);

private void PauseBtn_Click(object sender, EventArgs e)


{
if(martha.State == SynthesizerState.Speaking)
{
martha.Pause();
PauseBtn.Text = "resume";
}
else
{
if(martha.State == SynthesizerState.Paused)
{
martha.Resume();
PauseBtn.Text = "pause";
}
}
}

private void StopBtn_Click(object sender, EventArgs e)


{
if(martha.State == SynthesizerState.Speaking)
{
martha.SpeakAsyncCancelAll();
StopBtn.Text = "stop";
ReadBtn.Enabled = true;
}
}

private void label2_Click(object sender, EventArgs e)


{

private void label9_Click(object sender, EventArgs e)


{

private void OpenBtn_Click(object sender, EventArgs e)


{
if (martha.State == SynthesizerState.Speaking)
{
martha.SpeakAsyncCancelAll();
}
Readtxt.Clear();
martha.SpeakAsync("chose a text file form your derives");
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "txt files (*.txt)|*.txt|rtf files (*.rtf)|*.rtf|All files(*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
string strfilename = openFileDialog1.FileName;
string filetext = File.ReadAllText(strfilename);
Readtxt.Text = filetext;
}
catch (Exception ex)
{
MessageBox.Show("Error: could not read the file from disk:" + ex.Message);
}
}
}
public void AllEmails()
{
try
{

System.Net.WebClient objclient = new System.Net.WebClient();


string response;
string title;
string summary;
string tagline;
//creating a new xml document
XmlDocument doc = new XmlDocument();

//logging in gmail server to get data


objclient.Credentials = new System.Net.NetworkCredential(textBox1.Text, textBox2.Text);
//reading data and converting to string
response = Encoding.UTF8.GetString(
objclient.DownloadData(@"https://mail.google.com/mail/feed/atom"));

response = response.Replace(
@"<feed version=""0.3"" xmlns=""http://purl.org/atom/ns#"">", @"<feed>");

//loading into an XML so we can get information easily


doc.LoadXml(response);
//counting all emails
string total_mails = doc.SelectSingleNode(@"/feed/fullcount").InnerText;
total_emails.Text = total_mails;
martha.SpeakAsync("total number of emails are" + total_mails + "in the mail box");
//tag line
tagline = doc.SelectSingleNode("/feed/tagline").InnerText;
//Email_Tags_Lines.Text = tagline;
martha.SpeakAsync("sir you have" + tagline);
//reading the title and the summary for every email
/* foreach (XmlNode node in doc.SelectNodes(@"/feed/entry"))
{
//reading the email authorfrom atom feed
Email_Author.Text = node.SelectSingleNode("author").SelectSingleNode("name").InnerText;
martha.SpeakAsync("Email from" + Email_Author.Text.ToString());
// reading a title of email
title = node.SelectSingleNode("title").InnerText;
Message_title.Text = title;
martha.Speak("sir,mail is about" + title.ToString());
//getting email summary
summary = node.SelectSingleNode("summary").InnerText;
Message_Summary.Text = summary.ToString();
martha.Speak("and the summary is" + summary.ToString());
}*/
}
catch (Exception ex)
{
martha.Speak("please login to your gmail account and turnm less secure apps to get this done");
MessageBox.Show("login to youir gmail account and turn on less secure apps" + ex.Message);
System.Diagnostics.Process.Start("https://support.google.com/accounts/answer/6010255?h1=en");
}
}

private void button2_Click_1(object sender, EventArgs e)


{
username = textBox1.Text;
password = textBox2.Text;
}

private void label9_Click_1(object sender, EventArgs e)


{

}
private void PronounceBtn_Click(object sender, EventArgs e)
{
martha.SpeakAsync(textBox3.Text);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if(checkBox1.Checked )
{
textBox2.UseSystemPasswordChar = false;
}
else
{
textBox2.UseSystemPasswordChar = true;
}
}

private void gmailstopbutton_Click(object sender, EventArgs e)


{
if (martha.State == SynthesizerState.Speaking)
{
martha.SpeakAsyncCancelAll();
}
}

public void CheckEmails()


{
string GmailAtomUrl = "https://mail.google.com/mail/feed/atom";
XmlResolver xmlResolver = new XmlUrlResolver();
xmlResolver.Credentials = new NetworkCredential(username,password);
XmlTextReader xmlReader = new XmlTextReader(GmailAtomUrl);
xmlReader.XmlResolver = xmlResolver;
try
{
XNamespace ns = XNamespace.Get("http://purl.org/atom/ns#");
XDocument xmlfeed = XDocument.Load(xmlReader);

var emailItems = from item in xmlfeed.Descendants(ns + "entry")


select new
{
Author = item.Element(ns + "author").Element(ns + "name").Value,
Title = item.Element(ns + "title").Value,
Link = item.Element(ns + "link").Attribute("href").Value,
Summary = item.Element(ns + "summary").Value
};
Form1.MsgList.Clear();
Form1.MsgLink.Clear();
foreach (var item in emailItems)
{
if (item.Title == String.Empty)
{
Form1.MsgList.Add("message from" + item.Author + ",there is no subject and the the
summary reads, " + item.Summary);
Form1.MsgLink.Add(item.Link);
}
else
{
Form1.MsgList.Add("message from" + item.Author + ",the subject is" + item.Title + "and
summary reads" + item.Summary);
Form1.MsgLink.Add(item.Link);
}

}
if (emailItems.Count() > 0)
{
if (emailItems.Count() == 1)
{
martha.SpeakAsync("you have one new email");
}
else
{
martha.SpeakAsync(" you have " + emailItems.Count() + " new emails ");
}
}
else if (Form1.QEvent == "checkfornewemails" && emailItems.Count() == 0)
{
martha.SpeakAsync("you have no emails");
Form1.QEvent = String.Empty;
}
}
catch (Exception ex)
{
martha.SpeakAsync("you have submmited invalid login information");
martha.SpeakAsync("please login to your gmail account and turn on permission to less secure
apps" + ex.Message);
}
}

private void webBrowser1_DocumentCompleted(object sender,


WebBrowserDocumentCompletedEventArgs e)
{

private void button2_Click_2(object sender, EventArgs e)


{

private void newsplaybtn_Click(object sender, EventArgs e)


{

}
private void Newsstopbtn_Click(object sender, EventArgs e)
{
if(martha.State== SynthesizerState.Paused)
{
martha.Resume();
}
martha.SpeakAsyncCancelAll();
}

private void newspausebtn_Click(object sender, EventArgs e)


{

private void button3_Click(object sender, EventArgs e)


{

private void getbingnewsbtn_Click_1(object sender, EventArgs e)


{

}
}

TESTING
Initialization of martha in windows platforrm/Gmail Reader
Martha Text reader
Martha media player

Martha pronouncer
Conclusion
The results gathered from the tests with Martha have given evidence to support our
hypothesis. This was achieved byMartha showing the capability to meet the requirements
discussed to support our initial hypothesis. Throughout the conversations with martha
during tests outputs given were appropriate and contextual to the input. This contextual
awareness allowed the program to expand on the appropriate answer with data that is
related to the subject by the now unique metadata. The end result of this is an expanded
response which in turn goes beyond appropriate and becomes useful in a meaningful way
to the user. It is this expansion that allows the trained instance of Kari to function as a
useful VPA whiles its personalization and contextual awareness give the user control of
its unique library of data and metadata. Throughout the analysis and testing of the
program, a number of potential improvements for the ideal virtual assistant have been
identified. The ideal virtual assistant will be a program with the natural language
recognition already present in current chat bots. This should be paired with a learning
algorithm and natural language processing capabilities, including imitation of emotional
engagement similar to that of Kari’s, where key words are used to identify patterns
between data. The bot should hold a small preset library containing basic conversations
(small talk, greetings) and provocations to continue the conversation (questions,
curiosity). It is the questions and curiosity of the program that creates the demand for
attention that provokes the user into actively using the supporting system for any scenario.
The extent of the potential to use this type of technology doesn’t end there however. The
idea of an artificially intelligent personal system that supports the user specifically
instead of working as an data service provider is a subject area that is constantly
expanding and crying out for attention. A capable program could be used as an effective
tool for anything ranging from work use to personal use while remaining a user-based
system. In this paper we have looked at examples of programs that showcase the various
technologies and functions that, when combined, have the capacity to form an effective
virtual assistant. This is using technologies that are already present and applied
throughout the world today with a huge scope for expansion in the future. The social
aspects of these programs have shown logical and emotional engagement and
development of their controlled knowledge base. These social aspects play a big role in
motivating a user to actively engage with the system and simulated emotion is being
developed by IBM to integrate into Watson [5]. This emotional engagement will further
build upon the already capable pattern recognition to allow for the better understanding
of logical inconsistencies in data. The patterns formed between data helps each program
to react differently to different inputs. When this is combined with the local storage of
data libraries it becomes a personalisation of the program. The programs function will be
uniquely different as it understands the data in relation to the user. If the technology that
is present is integrated with the ideas of personal ownership of support system(including
ongoing metadata creation and analysis) as discussed in this paper a new form of virtual
assistant could be created. This virtual and personal assistant, which is capable of
emulating both logical and emotional interest in the interaction with its user, is a
missing link in business support as it falls within the category of user support, supporting
the end user in their needs and efforts.
Bringing these ideas and technologies together would lead the way for a truly useful
virtual personal assistant. Logical aspects make the system usable, however the
combination of logical with emotional aspects make such a system worthwhile, and so
ultimately useful for the user.
FUTURE ENHANCEMENT

You might also like