-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaht_bot
More file actions
50 lines (42 loc) · 1.08 KB
/
Copy pathcaht_bot
File metadata and controls
50 lines (42 loc) · 1.08 KB
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
41
42
43
44
45
46
47
48
49
50
from nltk.chat.util import Chat, reflections
#Aqui definimos las pŕeguntas y posibles respuestas
pairs = [
[
r"my name is (.*)",
["Hello %1, How are you today?",]
],
[
r"what is your name?",
["My name is Chat the chat boy, nice to meet you pal",]
],
[
r"How are you?",
["Im doing good \n How about you?",]
],
[
r"sorry (.*)",
["its alright", "Its OK, never mind",]
],
[
r"im doing good",
["Nice to hear that", "Alrighty then"]
],
[
r"(.*) age?|how old are you?",
["Im a computer program dude \n Seriously you're asking me this?"]
],
[
r"What (.*) want",
["Make me an offer I cant refuse"]
],
[
r"quit",
["Bye bye, see you soon|"]
],
]
def chattyboy():
#Mensaje inicial para dar instrucciones y presentarse.
print("Hello im Chat the chat boy!\n Plase type lowercase English languaje to start conversation, Type quit to leave")
chat = Chat(pairs, reflections)
chat.converse()
chattyboy()