-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathname.py
42 lines (35 loc) · 1.35 KB
/
name.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
41
42
import ner
def names_original():
return {"chatbot_name": "Alex",
"user_name": "User"}
# Get string from name where it could include "my name is"
def getName(text: str) -> str:
return ner.getNamedEntity("PERSON", text)
def nameResponse(names: list) -> str:
from random import choice
responses = [
f"Great! Hi {names['user_name']}! How can I help?",
f"Good! Hi {names['user_name']}, how can I help you?",
f"Cool! Hello {names['user_name']}, what can I do for you?",
f"OK! Hola {names['user_name']}, how can I help you?",
f"OK! Hi {names['user_name']}, what can I do for you?",
f"Hello {names['user_name']} - it is nice to meet you. What can I help you with?"]
return choice(responses)
def get_user_name_response(name: str) -> str:
from random import choice
responses = [
f"You are {name}! How can I help?",
f"Your name is {name}, how can I help you?",
f"They call you {name}, what can I do for you?",
f"Your name is {name}, how can I help you?"
]
return choice(responses)
def get_chatbot_name_response(name: str) -> str:
from random import choice
responses = [
f"My name is {name}, how can I help?",
f"You can call me {name}",
f"You may call me {name}",
f"Call me {name}"
]
return choice(responses)