1. induce new rules that hold on existing input
2. deduce answers from existing input by given rules
3. generate semi-random thoughts for chit-chat if you're building a chatbot
IF you are talking about adding a memory to a chatbot the personality forge does that. I don't recall off hand what programming language it uses but some thing on that order would work.
If thoughts were owl files
The problem with this is, is how did the thoughts get in there? If its just what the robot saw, then its just regurgitation of the text going in. (what you are trying to avoid.) which is what we do.
trigger => template
trigger => template
trigger => template
trigger => template
...etc
I would want to keep a great number of recent thoughts in active memory for fast access. Depends on what you mean by "thoughts" though.
{
"source" : [
"AreaName1",
"AreaName2",
"AreaName3"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
}
{
"slot1" : {
"source" : [
"AreaName1"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
},
"slot2" : {
"source" : [
"AreaName2"
"AreaName3"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
}
}
{ slot1:
{ source:
[ AreaName1
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
{ trigger:
here another pattern
template:
here another template
slot2:
{ source:
[ AreaName2
AreaName3
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
{ trigger:
here another pattern
template:
here another template
main:
{ source:
[ slot1
slot2
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
I play first, with trivial stuff. We could have area files like this:Code{
"source" : [
"AreaName1",
"AreaName2",
"AreaName3"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
}
This one would be straightforward: this area treats information from its 3 sources the same way, no matter where it comes from. But we might want to have different trigger/template pairs for data from different sources. So I change the syntax a little, to allow different behaviors for different sources:Code{
"slot1" : {
"source" : [
"AreaName1"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
},
"slot2" : {
"source" : [
"AreaName2"
"AreaName3"
],
"behavior" : [
{ "trigger" : "here some JSON pattern",
"template" : "here a JSON template"
},
{ "trigger" : "here another pattern",
"template" : "here another template"
}
]
}
}
Wow, tabs are big. Nevermind. Now, these are independent behaviors for different data sources. But we probably want to combine data from different sources. So, instead of outputting directly through "template", we could maybe store things for later, like this:Code{ slot1:
{ source:
[ AreaName1
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
{ trigger:
here another pattern
template:
here another template
slot2:
{ source:
[ AreaName2
AreaName3
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
{ trigger:
here another pattern
template:
here another template
main:
{ source:
[ slot1
slot2
behavior:
[ { trigger:
here some JSON pattern
template:
here a JSON template
(This is some kind of indented JSON, hopefully easier to read.)
Now we have a "main" slot, which can take outputs from other slots. It would react only if it has incoming data from every sources (here slot1 and slot2). If one source didn't send anything, "main" waits. Now, slot1 and slot2 don't output things directly, they just prepare preliminary stuff for "main" to process.
Am I understandable?
Then in templates, we insert what was previously captured by inserting a string containing <2>, which will be replaced by whatever was captured in the 2nd glob.
'// Move object
Sub MoveO(ByVal nn As Long, ByVal dd As Long)
FindO nn, cx, cy, cz
Select Case dd
Case 1 'forward
If m(cx, cy, cz - 1, 1) <> 0 Then
s$ = "Can't move the " & NameO(nn) & " forwards because the " & NameO(m(cx, cy, cz - 1, 1)) & " is in front of it"
Else
m(cx, cy, cz - 1, 1) = m(cx, cy, cz, 1)
m(cx, cy, cz, 1) = 0
s$ = "OK! I moved the " & NameO(nn) & " forward"
End If
Case 2 'back
If m(cx, cy, cz + 1, 1) <> 0 Then
s$ = "Can't move the " & NameO(nn) & " backwards because the " & NameO(m(cx, cy, cz + 1, 1)) & " is behind it"
Else
m(cx, cy, cz + 1, 1) = m(cx, cy, cz, 1)
m(cx, cy, cz, 1) = 0
s$ = "OK! I moved the " & NameO(nn) & " backward"
End If
End Select
Text2 = Text2 & s$ & vbCrLf
End Sub