Spaces:
Configuration error
Configuration error
Delete main-raw.py
Browse files- main-raw.py +0 -21
main-raw.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
import aiml
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
kernel = aiml.Kernel()
|
| 5 |
-
|
| 6 |
-
if os.path.isfile("bot_brain.brn"):
|
| 7 |
-
kernel.bootstrap(brainFile = "bot_brain.brn")
|
| 8 |
-
else:
|
| 9 |
-
kernel.bootstrap(learnFiles = os.path.abspath("aiml/std-startup.xml"), commands = "load aiml b")
|
| 10 |
-
kernel.saveBrain("bot_brain.brn")
|
| 11 |
-
|
| 12 |
-
# kernel now ready for use
|
| 13 |
-
while True:
|
| 14 |
-
message = raw_input("Enter your message to the bot: ")
|
| 15 |
-
if message == "quit":
|
| 16 |
-
exit()
|
| 17 |
-
elif message == "save":
|
| 18 |
-
kernel.saveBrain("bot_brain.brn")
|
| 19 |
-
else:
|
| 20 |
-
bot_response = kernel.respond(message)
|
| 21 |
-
print bot_response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|