-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunning.py
40 lines (35 loc) · 1.29 KB
/
running.py
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
37
38
39
40
from threading import Thread
import Emotion.module_emot as emo
from chatterbot import ChatBot
#from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer
depresso_bot=ChatBot("DepressionBot",read_only=True ,
logic_adapters=['chatterbot.logic.BestMatch',
{'import_path': 'chatterbot.logic.BestMatch',
'threshold': 0.65,
'default_response' : 'I am sorry, but I can only answer questions related to ACM.'
}
],
input_adapter = 'chatterbot.input.VariableInputTypeAdapter',
output_adapter = 'chatterbot.output.OutputAdapter',
filter = 'chatterbot.filters.RepetitiveResponseFilter'
)
trainer = ChatterBotCorpusTrainer(depresso_bot)
#trainer = ListTrainer(depresso_bot)
"""
trainer.train(
['Hello',
'Hi',
'Hello',
'Okay',
'Okay :)'
]
)
"""
trainer.train(
"chatterbot.corpus.english.greetings",
"chatterbot.corpus.english.conversations",
"chatterbot.corpus.english.emotion",
"chatterbot.corpus.english.psychology"
)
emo.emotion_detect(0, depresso_bot)