Skip to content

A linux based Virtual assistant on Artificial Intelligence in C

License

Notifications You must be signed in to change notification settings

riya-17/Virtual-Assistant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual-Assistant

A virtual assistant is a software agent that can perform tasks or services for an individual.The term ”chatbot” is also used to refer to virtual assistants.

Virtual assistants use Artificial Intelligence to match user text input to executable commands. It can provide a wide variety of services, These includes:

  • Weather forecast of any place
  • Play multimedia files such as audio songs and video songs
  • Open Applications such as Web browsers, Media players(like vlc), text editors, etc
  • Open directories in linux, Date and time
  • Search anything on Google
  • Open websites of user’s choice
  • Search anything on Youtube
  • Open Calendar of any year
  • Find Restaurants in an area

screenshot from 2017-11-04 23 13 18

How it all works?

We are reading user’s sentence and passing it through our Natural Language Processing code i.e “ Simplified Multinomial Naive Bayes Algorithm “. NLP code processes the sentence and redirects it to the action that should be performed based on the meaning of the sentence.

The functionality is executed such as

  • A media file (such as audio and media files) is played.
  • Weather forecast is shown after the user enters the location.
  • Calendar is shown of the desired year.
  • Youtube search is performed for the desired content.
  • Google search is performed for whatever the user wants to.
  • Restaurants in the given area/locality are shown.

If the virtual assistant have no idea about the user’s sentence, it will simply search that sentence on Google.

Artificial Intelligence

Simplified Multinomial Naive Bayes Algorithm

Given a set of sentences, each belonging to a class, and a new input sentence, we can count the occurrence of each word in each class, account for its commonality and assign each class a score. Factoring for commonality is important: matching the word “it” is considerably less meaningful than a match for the word “cheese”. The class with the highest score is the one most likely to belong to the input sentence. This is a slight oversimplification as words need to be reduced to their stems, but you get the basic idea.

A sample training set:

ai sample

Let’s classify a few sample input sentences:

screenshot from 2017-11-04 23 08 21

Notice that the classification for “What’s it like outside” found a term in another class but the term similarities to the desired class produced a higher score. By using an equation we are looking for word matches given some sample sentences for each class, and we avoid having to identify every pattern.

Setup

This program uses GNUstep speech engine for the purpose of text to speech. To use this feature few commands are needed:

say converts text to audible speech using the GNUstep speech engine.

$ sudo apt-get install gnustep-gui-runtime
$ say "hello"

Firefox is needed to perform browser tasks such as opening google and youtube.

$ sudo apt-get install firefox

In addition to this, following commands are needed to install the necessary packages.

$ sudo apt-get install libcurl4-openssl-dev

$ sudo apt-get install libjson0 libjson0-dev

Restaurant

Virtual Assistant can find restaurants in an area.

restaurants

Weather

This feature requires curl.To use this feature you need to first install curl as follows-

$ sudo apt-get install curl

weather

Media

Virtual assistant can play any audio or video files of your choice. For playing media files vlc is needed. Get it here

$ sudo apt-get install vlc
Please configure your working directory location before using this feature in config file (value of HOME_DIR)

video

Youtube Search

Virtual assistant can search anything on youtube.

search youtube for Artificial Intelligence

This will show all the videos on youtube related to Artificial Intelligence. Artificial Intelligence is an example here, you can use anything you want to search.

youtube

Google Search

Virtual assistant can search anything on Google.

googlesearch

Calendar

Virtual assistant can show calendar of any year.

open calendar

calendar

Help

Don't know how to use? Here use help command

help

help

Contributing Guide

  • This repository is strictly based on C language. No contributions other than C will be accepted.
  • When contributing to this repository, please first inform or discuss the change(s) you wish to make via an issue. This helps in letting others know what you're working on.
  • Before you push your changes to GitHub, make sure that your code compiles and runs without any errors or warnings.
  • New features are always welcome.

License

ritwik12/Virtual-Assistant is licensed under the GNU General Public License v3.0

Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.

About

A linux based Virtual assistant on Artificial Intelligence in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%