GithubHelp home page GithubHelp logo

ngugisenior / virtual-assistant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ritwik12/virtual-assistant

0.0 1.0 0.0 16.78 MB

A linux based Virtual assistant on Artificial Intelligence in C

License: GNU General Public License v3.0

C 100.00%

virtual-assistant's Introduction

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?

The user's sentence is read and passed through our Natural Language Processing (NLP) code for processing. After the sentence is processed, it's redirected to the action to be performed based on the meaning of the sentence. Our NLP code uses a simplified version of the Multinomial Naive Bayes Algorithm.

The following actions can be performed:

  • Play audio and media files
  • Display weather forecasts based on specified location
  • Display the calendar of a specified year
  • Perform YouTube video searches
  • Perform Google searches
  • Display restaurant recommendations

If the virtual assistant does not understand the user’s sentence, a Google search performed.

Artificial Intelligence

Simplified Multinomial Naive Bayes Algorithm

Each classification contains a set of sentences that inputs are matched to. Scores are assigned based on the occurrence of words of an input sentence for each of the classifications. Scores measure the commonality of an input sentence to a classification. The commonality between words and the classifications are important. For example, matching the word “it” is considerably less meaningful than a match for the word “cheese”. The input sentence is assigned the classification of the highest score. This is a simplification as words need to be reduced to their stems.

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

For Ubuntu (Debian based Linux)

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 libjson-c-dev
$ sudo apt-get install libssl0.9.8

For Fedora (RHEL based Linux)

This program uses Espeak for the purpose of text to speech.

espeak converts text to audible speech.

$ espeak "hello"

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

$ sudo yum install firefox

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

$ sudo yum install libcurl libcurl-devel
$ sudo yum install json-c json-c-devel
$ sudo dnf install openssl
$ sudo dnf install openssl-devel 

Compile

gcc main.c $(pkg-config --libs --cflags libcurl) -lssl -lcrypto -l json-c -std=gnu11

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

Or

$ sudo yum 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

Or

$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
$ sudo dnf install vlc
Please configure your working directory location before using this feature in config file (value of HOME_DIR)

media

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.

gsearch

Calendar

Virtual assistant can show calendar of any year.

open calendar

calendar

Emails

In order to send emails using Virtual-Assistant, you need to allow access from less secure apps on your gmail account. Open your gmail account on any browser, click on profile pick and then Google account. In the tab Security you have to activate the parameter Allow access from less secure apps.

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.

Want to ask something?

Please ask on FAQ or mail me at [email protected]

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.

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

Credits

This project is developed with contributions by Riya

virtual-assistant's People

Contributors

ritwik12 avatar gaellemarais avatar igo4jesus avatar rushikesh22 avatar riya-17 avatar lilyamel avatar jackycodes avatar speedy-software-ch avatar andy5995 avatar ellisken avatar pavan-pan avatar ngugisenior avatar joshua-deans avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.