Giter Site home page Giter Site logo

sparc-auburn / lab-assistant Goto Github PK

View Code? Open in Web Editor NEW
11.0 7.0 5.0 3.69 MB

The purpose of this project is to create a virtual assistant to assist SPARC members using Python. The virtual assistant will be fully featured including abilities to help in the lab to automating a home. It will include a system that allows for easy to use management of lab equipment and various administrative features. The virtual assistant could also be integrated on a mobile robotic platform to allow more capabilities that a static computing platform could. Our current iteration of the virtual assistant is named Karen.

Home Page: http://sparc-auburn.github.io/

License: Apache License 2.0

Python 98.24% Shell 1.76%
lab lab-assistant voice virtual assistant sparc auburn-university dialogflow auburn python

lab-assistant's Introduction

Lab-Assistant

Project Purpose

Project Diagram

The purpose of this project is to create a virtual assistant to assist SPARC members. SPARC stands for Student Projects and Research Committee and is a student led organization in the Department of Electrical Engineering at Auburn University. The virtual assistant will be fully featured including abilities to help in the lab to automating a home. It will include a system that allows for easy to use management of lab equipment and various administrative features. The virtual assistant could also be integrated on a mobile robotic platform to allow more capabilities that a static computing platform could. Our current iteration of the virtual assistant is named Karen.

Project Overview

Project Diagram

This project is programmed in Python. Python provides a simple yet powerful back end to run the assistant. The assistant can be run through several clients as outlined below to adapt to the various use cases. Suites are used to manage the intelligence of the assistant and can be turned on and off to allow flexibility. User commands are passed in from the clients through a suite manager python file. The suite managers loop through all of the suites to find the appropriate response and returns it back to the client. The suites communicate with a natural language processor named DialogFlow as described in more detail below.

Assistant Clients

  • Voice Client - Uses a microphone to take input from the user and speaks response back to user.
  • Text Client - Uses the terminal to allow user to type commands and receive responses.
  • Slack Client - Uses Slack messaging app to allow SPARC members to type commands and receive responses.
  • Device Client - Communicates with the other clients for device control on less powerful computing platforms.

Suites

  1. Default - A collection of basic responses.
  2. Lab - A collection of responses and functions pertaining to assisting users in the SPARC lab.
  3. Home - A collection of responses and functions pertaining to home automation and light control.
  4. Weather - A collection of responses and functions pertaining to processing weather commands.
  5. Personal - A collection of functions pertaining to personal commands like reminders, time, and alarms.
  6. Knowledge - A collection of functions to search Google, Bing, Wolfram Alpha, Wikipedia, or etc.
  7. Fallback - A collection of fallback responses if previous suites did not catch.

DialogFlow

Project Diagram

To help give the virtual assistant the ability to understand the English language, we are using a Google owned service called DialogFlow. It is a natural language processor in which it deconstructs user inputs into intents (meaning) and entities (specifics). Through customization and training, a machine learning algorithm can be tuned to allow the assistant to more intelligently communicate.

The DialogFlow documentation walks through an example of how it works: https://dialogflow.com/docs/getting-started/basics

Running the Assistant

Run Voice Client on PC using PyCharm (Windows, Ubuntu, etc.)

Project Diagram

PyCharm is a fully featured free Python IDE. It provides a powerful development studio for Python code. It can run Python programs in the same windows as the code is developed and integrates with git to allow a seemless experience. Another nice feature of PyCharm is the intelligent refactoring so that variables, classes, and even file names can be efficiently changed throughout the entire program.

  1. Install PyCharm Community Edition: https://www.jetbrains.com/pycharm/download/#section=windows
  2. Install Python 2.7.13: https://www.python.org/downloads/release/python-2713/. (Make sure that add to path is checked on Windows)
  3. Install git bash https://git-for-windows.github.io/.
  4. Clone directory into desired location using git clone "https://github.com/SPARC-Auburn/Lab-Assistant" in git bash.
  5. In PyCharm, press File > New Project...
  6. Press "..." button and navigate to cloned directory. Press "OK" and "Create"
  7. Press File > Settings... > Project: Lab-Assistant > Project Interpreter
  8. Change the Project Interpreter to be Python27/python.exe
  9. Press the green "+" button and add any Python libraries that are missing and press "OK".
  10. Plug in USB mic if computer does not have an integrated microphone.
  11. In the tree on the left, press voice_karen.py under the assistant folder.
  12. Start the voice client by running python voice_client.py by right clicking in the center of the screen and pressing Run voice_client.py
  13. Karen should now respond to your requests. (How are you?, Tell me a joke., etc.)
  14. If you need to stop the program press the red square in the toolbar.

Run Voice Client on PC or Raspberry Pi 2 or 3 using Debian Linux (Raspbian, Ubuntu, etc.)

Project Diagram

  1. Make sure installation is updated by running the following commands (This may take a long while):
    sudo apt-get update
    sudo apt-get upgrade
    sudo -H pip install --upgrade pip
    
  2. Clone directory into desired location using git clone "https://github.com/SPARC-Auburn/Lab-Assistant"
  3. Run installation script using:
    chmod +x ./install.sh
    sudo -H ./install.sh
    
  4. Change directory to assistant.
  5. Plug in USB mic if computer does not have an integrated microphone.
  6. Start the voice client by running python voice_client.py
  7. Karen should now respond to your requests. ("How are you?, Tell me a joke., etc.)
  8. If you need to stop the program use "CTRL-SHIFT-".

Contributing to the Project

Please see the CONTRIBUTING.md document in this repository for recommendations on how to contribute.

How to Create Suites

Suites are the best way to add your own, custom functions into the Assistant framework. There are only a few requirements for suites to be imported and used:

  1. There must be a class that is the same as the file name in camel case notation. (ie. defaultsuite - class DefaultSuite)
  2. The class must have an init and checkcommand() function. Use defaultsuite.py as a template.
  3. Replace the "CLIENT_ACCESS_TOKEN" with the CLIENT_ACCESS_TOKEN from DialogFlow's corresponding agent.
  4. Add additional recognition under the elif statement. To hook your method into the program, import the suite in manage_suites.py like from suites.newsuite import *. Add your suite to the suites array to be included in the processing of commands.

lab-assistant's People

Contributors

j-business avatar joshjab avatar mcberry23 avatar ryanamcgill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lab-assistant's Issues

Generalize assistant

  • Remove specific references to Karen.
  • Ensure general assistant customization at highest level.

UnicodeDecodeError: 'ascii' codec can't decode

gtts is not accepting encoded responses properly

Example:
Command heard: what is the weather in auburn today
Response: Today in Auburn it will be around 63°F and scattered showers.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 36: ordinal not in range(128)

Update CONTRIBUTING.md to represent development process

Include adding issues, working with projects, labels, milestones, releases, and etc.
Mention code is primarily in Python and provide links to resources (Codecademy, PyCharm, etc.)
Mention version control is in Github and provide links to resources (Overview of Git, Git for Windows, Source Tree, etc.)

Improve Wake Word Detection

  • Add required wake word detection for constant listening
  • Phrases can be "OK Karen" or "Hey Karen"
  • Can be generalized to be any assistant based on passed parameter

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.