-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatbot.html
More file actions
138 lines (130 loc) · 7.3 KB
/
Copy pathchatbot.html
File metadata and controls
138 lines (130 loc) · 7.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html>
<head>
<title>SHEP AI</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="shortcut icon" href="assets/test1.ico" type="favicon/ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
</head>
<body class="backgroundC">
<div class="topnav">
<p class="title" align="center">Dexter Shepherd</p>
<a align="left" class="topnavlogo"><img src="assets/eyeT.png" width="50px" height="50px"></a>
<a class="topnavleft" href="index.html">Home</a>
<a class="topnavleft" href="index.html#about">About</a>
<a class="topnavleft" href="downloads.html">Downloads</a>
<a class="topnavleft" href="contact.html">Contact</a>
<br>
<!-- <a align="right" href="https://www.facebook.com/SHEP-AI-101118428133298/" class="fa fa-facebook"></a>
<a align="right" href="https://twitter.com/ai_shep" class="fa fa-twitter"></a>
<a align="right" href="https://www.instagram.com/shep.ai/" class="fa fa-instagram"></a>
<a align="right" href="https://www.youtube.com/channel/UCQr_MHaJ53feVK19lDKDxCQ?view_as=subscriber" class="fa fa-youtube"></a> -->
<a align="right" href="https://www.linkedin.com/in/dexter-shepherd-1a4a991b8/" class="fa fa-linkedin"></a>
<a align="right" href="https://scholar.google.com/citations?hl=en&user=hJSy6CYAAAAJ" class="ai ai-google-scholar ai-2x"></a>
<a align="right" href="https://github.com/shepai" class="fa fa-github"></a>
<a class="topnavright" class="search-container"><input id="searchbar" type="text" placeholder="Search.." name="search"></a>
<a href="#" class="topnavright"><i onclick="search()" class="icon fa fa-search"></i></a>
<script src="search.js">
</script>
</div>
<!-- the main content -->
<div class="main">
<br>
<div align="center" class="iconPage">
<img class="imageCircle" src="assets/SHEPpython2.png">
</div>
<h2 id="about" class="headerText">Python SHEP library</h2>
<hr class="break">
<h3 class="contentText">
SHEP uses a neural network graph to store information. The library provides the ability to sort out data entered by the user. The data is sorted by
what it is entered with, and what data follows it. Using weighted values, the strength of connections is defined, which can increase when found together,
and decrease when not. The more inputs, the clearer correlations in data becomes.
<br><br>
SHEP is designed to take in input data. If your robot project has an array of different sensors, the values can be entered into SHEP and tasks learned.
Everytime A robot hears me clap my hands I might want it to play a sound back. SHEP will work out that everytime I clap I make a noise after, which means SHEP
would return the value of what I want it to say everytime I clap.
<br><br>
<font color="blue"><a href="downloads.html">Download the library</a></font> to get started! The file "SHEP.py" will need to be in the same folder as your code.
<br /><br />For the SHEP library to run, you will need to use any Python 3.
<br /><br />
<div align="center"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"></div>
<!-- Auto width -->
<form method="get" action="downloads/SHEP.py">
<button href="" class="btn1"><i class="fa fa-download"></i> Download</button>
</form>
<br/><br/>
<h5><b>Using SHEP</b></h5>
You can include the SHEP library using the following line:
<br />
<div class="codeBox"><font color="orange">from</font> SHEP <font color="orange">import</font> AI</div>
<br/>
<h4>The library has several functions the user can use.</h4>
<div class="textBox">
<br />
<i>class</i> = <b>AI</b>(<i>system pathway</i>) <font color="blue">-- This declares the AI with it's pathway to it's files</font>
<br /><br/>
<i>string_list</i> = <i>class</i>.<b>process</b>(<i>string_list_of_inputs</i>) <font color="blue">-- This finds the relevant items of data which match inputs </font>
<br /><br/>
<i>string_list</i> = <i>class</i>.<b>enterData</b>(<i>string_list_of_inputs</i>,<i>type</i>) <font color="blue">-- This finds the relevant items of data, the type is the connection type as a string (SNT and DNT) </font>
<br /><br/>
<i>string_list</i> = <i>class</i>.<b>getConnected</b>(<i>string_list_of_inputs</i>,<i>type</i>) <font color="blue">-- Find data which is strongly connected to parameters </font>
<br /><br/>
<i>class</i>.<b>link</b>(<i>string_of_items</i>,<i>items_to_link_to</i>) <font color="blue">-- Change/set the pathway during the program</font>
<br/><br/>
<i>class</i>.<b>negFeedback</b>(<i>string_list_of_inputs</i>, <i>string_list_to_lower</i>) <font color="blue">-- This code will search the data for possible outputs </font>
<br/><br/><br/>
string_list_of_inputs=["12,32,43,12","dog.jpg","sensorVal=23"]
<br/>
stringtypes=["sound","sight",""]
<br/><br/><br/>
Here is an example of searching the AI with user input, manual adding words to the data, asking the AI using a string and editing current words:
<div class="codeBox"><font color="orange">from</font> SHEP <font color="orange">import</font> AI
<br/> <font color="red">#This code represents input arrays from objects a camera system sees</font>
<br/> bot=AI(<font color="green">"test/testFiles/newGraph/"</font>)<font color="red">#Where I want the data stored</font>
<br/> print(bot.process([<font color="green">"cat"</font>,<font color="green">"hand"</font>,<font color="green">"apple"</font>]))
<br/> print(bot.process([<font color="green">"pat cat"</font>,<font color="green">"orange"</font>,<font color="green">"dog"</font>]))
<br/> print(bot.process([<font color="green">"cat"</font>,<font color="green">hand"</font>,<font color="green">"soup"</font>]))
<br/> print(bot.process([<font color="green">"pat cat"</font>,<font color="green">"bannana"</font>,<font color="green">"apple"</font>]))
<br/> print(bot.process([<font color="green">"cat"</font>,<font color="green">"rake"</font>,<font color="green">"hand"</font>]))
<br/> print(bot.process([<font color="green">"pat cat"</font>,<font color="green">"pear"</font>,<font color="green">"snake"</font>]))
</div></div>
<br/><br/><br/>
The code will at first show blank outputs as the correlations are not yet learned to be significant
<div class="codeBox" ><font color="blue">
======== RESTART: \Users\SHEP\AI\SHEPcode.py ========
<br/>[]
<br/>[]
<br/>[]
<br/>[]
<br/>[]
<br/>[]
<br/>>>>
</font></div>
<br>
After a few times...
<br>
<div class="codeBox" ><font color="blue">
======== RESTART: \Users\SHEP\AI\SHEPcode.py ========
<br/>['pat cat']
<br/>['cat']
<br/>['pat cat','hand']
<br/>['cat']
<br/>['pat cat','hand']
<br/>['cat']
<br/>>>>
</font></div>
<p>
The Code asociates the cat and hand together and sees that it always leads
to the patting of the cat. The patting of the cat leads to cat and eventually hand as well.
If this is somthing which the AI learns at different times we will not see this loop of a connection.
</p>
<br />
Within the zip folder holding the library, is a test demo code which shows the way the AI learns, and how it can be corrected using negative feedback
</div>
</h3></div>
</body>
<script>
</script>
</html>