%learn alice
Loading startup.xml... done (0.01 seconds)
Loading ai.aiml... done (0.10 seconds) Loading drugs.aiml... done (0.01 seconds) Loading money.aiml... done (0.02 seconds) Loading politics.aiml... done (0.01 seconds) Loading science.aiml... done (0.01 seconds) Loading emotion.aiml... done (0.07 seconds) Loading movies.aiml... done (0.08 seconds) Loading primeminister.aiml... done (0.01 seconds) Loading sex.aiml... done (0.07 seconds) Loading astrology.aiml... done (0.00 seconds) Loading food.aiml... done (0.03 seconds) Loading mp0.aiml... done (1.95 seconds) Loading primitive-math.aiml... done (0.01 seconds) Loading sports.aiml... done (0.01 seconds) Loading atomic.aiml... done (0.90 seconds) Loading geography.aiml... done (0.29 seconds) Loading mp1.aiml... done (1.29 seconds) Loading psychology.aiml... done (0.35 seconds) Loading stack.aiml... done (0.01 seconds) Loading badanswer.aiml... done (0.05 seconds) Loading gossip.aiml... done (0.04 seconds) Loading mp2.aiml... done (2.14 seconds) Loading pyschology.aiml... done (0.17 seconds) Loading stories.aiml... done (0.17 seconds) Loading biography.aiml... done (0.26 seconds) Loading history.aiml... done (0.00 seconds) Loading mp3.aiml... done (2.30 seconds) Loading reduction0.safe.aiml... done (2.06 seconds) Loading that.aiml... done (0.39 seconds) Loading bot.aiml... done (1.13 seconds) Loading humor.aiml... done (0.02 seconds) Loading mp4.aiml... done (1.53 seconds) Loading reduction1.safe.aiml... done (2.16 seconds) Loading update1.aiml... done (0.42 seconds) Loading bot_profile.aiml... done (0.05 seconds) Loading imponderables.aiml... done (0.02 seconds) Loading mp5.aiml... done (1.19 seconds) Loading reduction2.safe.aiml... done (1.70 seconds) Loading update_mccormick.aiml... done (0.04 seconds) Loading client.aiml... done (1.10 seconds) Loading inquiry.aiml... done (0.03 seconds) Loading mp6.aiml... done (0.97 seconds) Loading reduction3.safe.aiml... done (1.31 seconds) Loading wallace.aiml... done (0.31 seconds) Loading client_profile.aiml... done (0.10 seconds) Loading interjection.aiml... done (0.01 seconds) Loading music.aiml... done (0.01 seconds) Loading reduction4.safe.aiml... done (1.27 seconds) Loading xfind.aiml... done (0.01 seconds) Loading computers.aiml... done (0.05 seconds) Loading iu.aiml... done (0.01 seconds) Loading numbers.aiml... done (0.09 seconds) Loading reduction.names.aiml... done (1.63 seconds) Loading continuation.aiml... done (0.01 seconds) Loading knowledge.aiml... done (0.68 seconds) Loading personality.aiml... done (0.05 seconds) Loading reductions-update.aiml... done (0.01 seconds) Loading date.aiml... done (0.02 seconds) Loading literature.aiml... done (0.02 seconds) Loading phone.aiml... done (0.01 seconds) Loading religion.aiml... done (0.08 seconds) Loading default.aiml... done (1.19 seconds) Loading loebner10.aiml... done (0.01 seconds) Loading pickup.aiml... done (0.02 seconds) Loading salutations.aiml... done (0.04 seconds)
Once learned, we can start to talk with the bot
Hi
How are you?
I'm ok
Do you like reading?
I don't know
Note that we can write more than one sentence. Alice will process both sentences and produce each output in sequence
What's the meaning of life? Do you like music?
We can use the %setp
magic to define bot predicates. The patterns in Alice rules already make use of some bot predicates, so if we define them they will make the conversation more interesting
What's your name?
%setp bot name Alice
What's your name?
# Let's define a few more bot predicates, from among the ones used in Alice categories
%setp bot master Richard Wallace
%setp bot master Botmaster
%setp bot favoritebook Tale of Two Cities
%setp bot favoritemovie Blade Runner
%setp bot location Moonbase Alpha
# Other bot predicates used in ALICE DB:
# emotions celebrity friend friends size gender age
# kingdom order family genus species
We can inspect the currently defined bot predicates and we will see that they have been defined
%show bot
What's your favorite book?
Not yet
What's your favorite movie?
No
What did you like most?
To inspect the bot state there are a few magics available. We have already seen %show bot
, which shows the defined bot predicates. Another one is %show session
, which shows the session predicates.
%show session
And the %bot size
magic shows the number of defined categories
%show size
The predicates that we have defined can be saved to a file by using the %save
magic
%save alice-predicates nobrain nosub rawfiles
Saving session predicates... 2 predicates Saving bot predicates... 5 predicates Skipping subs Skipping brain patterns Writing main bot file: alice-predicates.ini
This file can be loaded later on with %load
. There are additional options to make it save the full brain state (all defined categories, in compiled form) and substitution strings. See 03-chatbot-inline for additional examples.