Python SHEP library
SHEP uses a neural network graph to store information. The library provides the ability to sort out data entered by the user. The current
SHEP version is made as a chatbot interface allowing a client side and admin side. The next version in development will add self learning.
For now it is up to the developer how they wish to use the code.
SHEP has an in-built language analyser which will break down sentences into either questions or statements. Questions will be checked to whether
they have some form of answer, and statements will be entered as feedback into a database. The developer can use this information to teach the
AI about information. It is really down to the developer. Statements can be added as questions using the admin bot class.
Download the library to get started! The file "AI.py" will need to be in the same folder as your code.
For the SHEP library to run, you will need to use any Python 3.
Main bot
The code will set up a main bot which will load in the data and create all needed files for it to function.
Admin bot
The admin bot is the class used to interact with the data and teach the main bot. This could be through making an admin account to oversee your program, or making this admin bot manage the self learning aspects.
Client bot
This is the class used by the user. It is a simple enter in and get out. The client has the ability to provide "negative feedback" to the bot, in order to teach it when it goes wrong. This can be set up in a way of your chosing. Perhaps a sound sensor, and when it detects shouting it sets to negative feedback.
Future versions
Future versions will have more inbuilt self learning features, and adaptive behaviour rather than pre-programmed aspects such as the language analyser. This is all still in development.
Using SHEP
You can include the SHEP library using the following line:from SHEP import *
Declarations
bot = Bot(name,system pathway) -- This declares the AI with it's pathway to it's files
ReportData=dataBase(pathway,filename) -- This is the database which will store reported data in, it must be global
Adminclass=adminBot(bot) -- This is the admin bot being declared
clientclass=botClient(bot) -- This is the client bot being declared
Admin usage
Adminclass.getToAdd() -- Return a list of all the confused data items. The questions which have no responseAdminclass.add(question,answer) -- This adds the phrase to the answer. Both entered as strings
Adminclass.addStatement(statementStrng) -- This adds a statement to the statement database. "This bot is cool"
Adminclass.deletes(question) -- This deletes an item from the confused data log. The questions which have not been learned
Adminclass.deleteQ(question) -- This deletes a question from the main question --> answer data
Adminclass.getFeedback() -- Return a list of statements said broken down into meaning. "Toielt->smells"
Adminclass.readReport() -- Read all the data from the report database (only works if report declared globally before)
Adminclass.addConfused(sentence) -- Add a sentence to the confused data file to be checked
Client usage
clientclass.Enter(userInput,previous_subject_array) --Enter your sentence, and the subjects of the last (or an empty array to not be complicated). Get an answer backclientclass.add(question,answer) --add question to answer in data
clientclass.feedback(type,sentence) --Give "negative" as type to enter a question for checking
clientclass.report(question) -- Report a question to be viewed by admin and checked
from SHEP import *
#This code represents input arrays from objects a camera system sees
#This code represents input arrays from objects a camera system sees