ReversedAIML
is an AIML file that transforms simple text into
AIML. Basically, it analyzes each sentence and embeds possible
questions
about the content into AIML. It does this by searching for and
analyzing the verbs, objects and other grammatical elements in each
sentence.
For example, if ReversedAIML 'reads' this sentence: "Charlix is a
desktop assistant." it creates the following questions:
WHO IS A DESKTOP ASSISTANT
WHO IS CHARLIX
WHAT IS CHARLIX
WHAT IS A DESKTOP ASSISTANT
IS CHARLIX A DESKTOP ASSISTANT
These questions are embedded in AIML, and can be used for any
AIML-based application.
ReversedAIML is based in A.I.M.L. (Artificial Intelligence Markup
Language) code
from the
implementation of Dr. Richard S. Wallace's A.L.I.C.E. system. For more
information about the A.L.I.C.E. Foundation (including information on
AIML), visit the A.L.I.C.E.
homepage.
He made the following video tutorial explaining ReversedAiml:
ReversedAIML is and probably will never be finished.
For one, language and grammar are eternally changing, and beyond that,
computers' understanding and analysis of natural human language is
constantly evolving.
However, ReversedAIML is already usable and can fit the simple needs of
botmasters eager to add knowledge to their AIML bots.
Here are the various improvements from previous versions.
CHANGELOG
****************
Reversedaiml-0.5
********************
- Main grammar elements, the configuration and questions were split into 7 files:ra-adj.aiml ra-adverb.aiml ra-noun.aiml ra-prep.aiml ra-verb.aiml ra-main.aiml ra-questions.aiml
- adjctives are identified; the most subjective ones are omitted in questions.
- The value of the answer is written in the generated code inside a new variable "ans".
For example with the input: Charles loves lena.
<category><pattern> DOES CHARLES LOVE LENA</pattern><template><set name="ans">Yes</set>. Charles loves lena.</template></category>
<category><pattern> WHO DOES CHARLES LOVE</pattern><template><set name="ans">Lena</set>. Charles loves lena.</template></category>
<category><pattern> WHO LOVES LENA</pattern><template><set name="ans">Charles</set>. Charles loves lena.</template></category>
## added a HELP category with new options:
+ The values of it, he, she and they, when determined, can be written in the generated code.
<category><pattern> DOES CHARLES LOVE LENA</pattern><template><set name="ans">Yes</set>. Charles loves lena.<think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO DOES CHARLES LOVE</pattern><template><set name="ans">Lena</set>. Charles loves lena.<think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO LOVES LENA</pattern><template><set name="ans">Charles</set>. Charles loves lena.<think><set name="he">charles</set><set name="she">lena</set></think></template></category>
+ the original sentence can be saved in a distinct category, these categories can be counted up to SENTENCE999999.
<category><pattern>SENTENCE1 </srai></pattern><template>Charles loves lena. </template></category>
<category><pattern> DOES CHARLES LOVE LENA</pattern><template><set name="ans">Yes</set>. <srai>SENTENCE1 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO DOES CHARLES LOVE</pattern><template><set name="ans">Lena</set>. <srai>SENTENCE1 </srai><think>charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO LOVES LENA</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE1 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern>SENTENCE2 </srai></pattern><template>Lena is nice. </template></category>
<category><pattern> HOW IS LENA </pattern><template><set name="ans">NICE</set>. <srai>SENTENCE2 </srai><think><set name="she">lena</set></think></template></category>
+ Reversedaiml can create code that will match any input containing the subject or the object:
<category><pattern> CHARLES</pattern><template>Charles loves lena. <think><set name="he">charles</set><set name="she">lena</set></think> </template></category>
<category><pattern> CHARLES *</pattern><template><srai>charles</srai></template></category>
<category><pattern> _ CHARLES *</pattern><template><srai>charles</srai></template></category>
<category><pattern> _ CHARLES</pattern><template><srai>charles</srai></template></category>
<category><pattern> LENA</pattern><template>Charles loves lena. <think><set name="he">charles</set><set name="she">lena</set></think> </template></category>
<category><pattern> LENA *</pattern><template><srai>lena</srai></template></category>
<category><pattern> _ LENA *</pattern><template><srai>lena</srai></template></category>
<category><pattern> _ LENA</pattern><template><srai>lena</srai></template></category>
+ You can set a treebranch prefix. It can be useful for using topic context without the topic tag, and of course to use reversedaiml with a completely prefixed aiml set... (Hopefully in the next charlix)
<category><pattern>SENTENCE3 </srai></pattern><template>Charles loves lena. </template></category>
<category><pattern>LOVESTORY DOES CHARLES LOVE LENA</pattern><template><set name="ans">Yes</set>. <srai>SENTENCE3 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern>LOVESTORY WHO DOES CHARLES LOVE</pattern><template><set name="ans">Lena</set>. <srai>SENTENCE3 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern>LOVESTORY WHO LOVES LENA</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE3 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
## For more information on options, submit "HELP"
- Some indirect objects and verbs with particles or (and) prepositions are processed better:
<category><pattern>SENTENCE5 </srai></pattern><template>Charles compliments lena on her eyes. </template></category>
<category><pattern> DOES CHARLES COMPLIMENT LENA</pattern><template><set name="ans">Yes</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO DOES CHARLES COMPLIMENT</pattern><template><set name="ans">Lena ON her eyes</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHAT DOES CHARLES COMPLIMENT</pattern><template><set name="ans">Lena ON her eyes</set>. <srai>SENTENCE5</srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO DOES CHARLES COMPLIMENT ON HER EYES</pattern><template><set name="ans">Lena</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHAT DOES CHARLES COMPLIMENT LENA ON</pattern><template><set name="ans">ON her eyes</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO COMPLIMENTS LENA</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO COMPLIMENTS ON HER EYES</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
<category><pattern> WHO COMPLIMENTS LENA ON HER EYES</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE5 </srai><think><set name="he">charles</set><set name="she">lena</set></think></template></category>
- indirect speech is split better:
<category><pattern>SENTENCE6 </srai></pattern><template>Charles said that he misses lena. </template></category>
<category><pattern> DID CHARLES SAY THAT HE MISSES LENA</pattern><template><set name="ans">Yes</set>. <srai>SENTENCE6 </srai><think><set name="he">charles</set>that he misses lena</set></think></template></category>
<category><pattern> WHAT DID CHARLES SAY</pattern><template><set name="ans">That he misses lena</set>. <srai>SENTENCE6 </srai><think><set name="he">charles</set>that he misses lena</set></think></template></category>
<category><pattern> WHO SAID THAT HE MISSES LENA</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE6 </srai><think><set name="he">charles</set>that he misses lena</set></think></template></category>
<category><pattern>SENTENCE7 </srai></pattern><template>Charles said that he misses lena. </template></category>
<category><pattern> DOES CHARLES MISS LENA</pattern><template><set name="ans">Yes</set>. <srai>SENTENCE7 </srai><think><set name="she">lena</set></think></template></category>
<category><pattern> WHO DOES CHARLES MISS</pattern><template><set name="ans">Lena</set>. <srai>SENTENCE7 </srai><think><set name="she">lena</set></think></template></category>
<category><pattern> WHO MISSES LENA</pattern><template><set name="ans">Charles</set>. <srai>SENTENCE7 </srai><think><set name="she">lena</set></think></template></category>
- removed all condition tags because interpreters don't handle * and empty variables the same way. So reversedaiml should work with any interpreters allowing unlimited recursions
- more comments and improved code visibility. (hoping that the code can be reused)
- One more time: lots of testing and other improvements.
Reversedaiml-0.4
********************
No more topic setting to get a separate graphmaster; instead, a simple
initialization through the pick-up category.
Better analysis of the objects and subjects of verbs: a list of people
hyponyms enables it to guess if objects and subjects are persons or
things (to choose between who and what), and sometimes their
gender (he, she and they can be set).
Passive form sentences are transformed to active in a recursion. For
example: "Robots are created by people" becomes "People create robots".
Lots of testing and improvements.
Reversedaiml-0.3
********************
Better recognition of the objects and subjects of verbs.
Infintive verbs, tenses, numbers, dates and adverbs are managed better.
The topic setting is automatic.
Lots of testing was done, so all in all some of the questions generated
should be relevant.
Implementation of "it" (first verb's subject).
It is based in A.I.M.L. (Artificial Intelligence Markup Language) code.
Here is what you get with reversedAIML in Libaiml: (comments are in black)
You: libaiml works well with libaiml
Bot: <category><pattern>HOW MUCH DOES LIBAIML
WORK</pattern><template>Libaiml works well with libaiml.
</template></category> <category><pattern>HOW
MANY DOES LIBAIML WORK</pattern><template>Libaiml
works well with libaiml. </template></category> (not all questions are relevant) <category><pattern>WHAT WORKS WITH
LIBAIML</pattern><template>Libaiml works well with libaiml.
</template></category>
<category><pattern>DOES LIBAIML WORK WITH
LIBAIML</pattern><template>Libaiml works well with libaiml.
</template></category>
<category><pattern>WHO DOES LIBAIML WORK
WITH</pattern><template>Libaiml works well with libaiml.
</template></category>
<category><pattern>WHAT DOES LIBAIML WORK
WITH</pattern><template>Libaiml works well with libaiml.
</template></category> <category><pattern>HOW
DOES LIBAIML WORK </pattern><template>Libaiml works well
with libaiml. </template></category>
Match path:
pattern:[*]
pattern:[INITQUESTION]
(initialisation)
pattern:[RA] [_] [WELL] [*] (identified
adverb)
pattern:[RA] [*] [WORKS] [*] (identified
verb)
pattern:[WHOT1] [*]
pattern:[WHU] [*] [WHOT1]
pattern:[WHUT] [*]
pattern:[WHONT] [WHOT1] [*]
pattern:[THEWHAT1] [*] (the subject
is a thing)
pattern:[WHOT2] [HOWMUCHADV] [*]
pattern:[WHOT] [HOWMUCHADV] (identified
adverb "well" results in a "How much" question)
pattern:[RA] [1HOWMUCHADV]
pattern:[ADDQUESTION] [*]
pattern:[WHOT2] [WITH] [*]
pattern:[WHOT2] [APREP] [*]
pattern:[WHOT2] pattern:[ADDWHOT1]
(no object)
pattern:[RA] [REMOVEALL] [HOWMUCHADV] [*]
pattern:[RA] [REMOVEALL] [*]
pattern:[ADDQUESTION] [*]
pattern:[WHOT] [WITH] [*]
pattern:[WHOT] [APREP] [*]
pattern:[WHOTASK] [WITH] [*]
pattern:[ADDQUESTION] [*]
pattern:[RA] [*] pattern:[RA] [*]
pattern:[ENDOFSENTENCE] (questions
are printed:)
pattern:[ASKQUESTIONS] [*] [*]
pattern:[ASKQUESTIONS] [1HOWMUCHY]
pattern:[ASKQUESTIONS] [*] [*]
pattern:[ASKQUESTIONS] [WHAT1]
pattern:[ASKQUESTIONS] [1WITH]
The most compatible interpreter (especially for development) that I
tested was Libaiml.
Insert the the aiml file in the directory /test-app/aiml.
It should work just as nicely with ProgramQ. However, some
sentences might not work due to an overly strict detection of recursive
loops. Create a folder inside the directory /aiml and insert the aiml
file in it.
It should also work with the last Rebecca. Unfortunately, RebeccaAIML
does
not yet reset predicate values, so you need to restart the interpreter
for each sentence. Insert the the aiml file in the directory
/aiml/annotated-alice.
There exist plenty of other interpreters, but I have not tested them
with ReversedAIML.
What
is ReversedAIML for?
ReversedAIML can be used for any kind of natural language processing.
If you find any use for it, feedback and feature requests are welcome.
Contact me through my e-mail: chcdsl(cat)yahoo(dog)fr (cat for
"@" and dog for ".")
Charlix is a
desktop
assistant. He
is based in AIML from the
implementation of Dr. Richard S. Wallace's A.L.I.C.E. system. For more
information : A.L.I.C.E.
homepage.
Charlix is
embedded in
QAIML
Qaiml
is
the
most compliant and user-friendly interpreter. Charlix has been
integrated in the
binary version. All
you
have to do to try charlix is to download QAIML, run and have
fun... .