-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTraining.py
More file actions
36 lines (25 loc) · 804 Bytes
/
Copy pathTraining.py
File metadata and controls
36 lines (25 loc) · 804 Bytes
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
import time
import math
import pyttsx
from chatterbot import ChatBot
AI_Bot = ChatBot("Scofield",
trainer="chatterbot.trainers.ChatterBotCorpusTrainer",
storage_adapter="chatterbot.adapters.storage.MongoDatabaseAdapter",
io_adapters=[
"chatterbot.adapters.io.TerminalAdapter"
],
database="scofield")
engine=pyttsx.init()
engine.setProperty('rate', 180)# words per minute
print "AI Bot Training Initiated."
engine.say("AI Bot Training Initiated.")
engine.runAndWait()
start=time.time()
AI_Bot.train("chatterbot.corpus")
end=time.time()
total_time=round(end-start,2);
answer="AI Bot trained successfully in " + str(total_time) + " seconds";
print answer
engine.say(answer)
engine.runAndWait()
time.sleep(2)