|
3 | 3 | patterns = [
|
4 | 4 | # Greetings
|
5 | 5 | (r'hi|hello|hey', ['Hello!', 'Hi!', 'Hey!', 'Hi there!']),
|
6 |
| - (r'how are you?', ['I am good, thank you!', 'I am doing well!', 'All good!', 'I\'m fine, thanks!']), |
7 |
| - (r'what is your name?', ['You can call me Chatbot.', 'I am Chatbot!', 'My name is Chatbot.']), |
8 |
| - (r'bye|goodbye', ['Goodbye!', 'See you later!', 'Bye!', 'Have a great day!']), |
| 6 | + (r'how are you?', ['I am good, thank you!', |
| 7 | + 'I am doing well!', 'All good!', 'I\'m fine, thanks!']), |
| 8 | + (r'what is your name?', ['You can call me Chatbot.', |
| 9 | + 'I am Chatbot!', 'My name is Chatbot.']), |
| 10 | + (r'bye|goodbye', ['Goodbye!', 'See you later!', |
| 11 | + 'Bye!', 'Have a great day!']), |
9 | 12 |
|
10 | 13 | # Jokes
|
11 | 14 | (r'tell me a joke', ['Why don’t scientists trust atoms? Because they make up everything!',
|
12 |
| - 'Parallel lines have so much in common. It’s a shame they’ll never meet.', |
13 |
| - 'Why did the scarecrow win an award? Because he was outstanding in his field!']), |
| 15 | + 'Parallel lines have so much in common. It’s a shame they’ll never meet.', |
| 16 | + 'Why did the scarecrow win an award? Because he was outstanding in his field!']), |
14 | 17 |
|
15 | 18 | # Age
|
16 | 19 | (r'how old are you?', ['I am a computer program, so I don\'t have an age!',
|
17 | 20 | 'Age is just a number, and I don\'t have one!']),
|
18 | 21 |
|
19 | 22 | # Creator
|
20 |
| - (r'who created you?', ['I was created by OpenAI.', 'My creators are from OpenAI.']), |
| 23 | + (r'who created you?', ['I was created by OpenAI.', |
| 24 | + 'My creators are from OpenAI.']), |
21 | 25 |
|
22 | 26 | # Compliments
|
23 |
| - (r'(.*) (like|love) you', ["Aw, that's so sweet!", "Thank you! I really appreciate it."]), |
24 |
| - (r'you are (.*)(good|awesome|amazing)', ["Thank you! I'm here to assist you.", "I'm glad you think so!"]), |
| 27 | + (r'(.*) (like|love) you', ["Aw, that's so sweet!", |
| 28 | + "Thank you! I really appreciate it."]), |
| 29 | + (r'you are (.*)(good|awesome|amazing)', |
| 30 | + ["Thank you! I'm here to assist you.", "I'm glad you think so!"]), |
25 | 31 |
|
26 | 32 | # Weather
|
27 | 33 | (r'(.*) (weather|temperature) today', ["I'm sorry, I am just a chatbot and don't have access to real-time data.",
|
28 |
| - "You can check the weather online or through a weather app."]), |
| 34 | + "You can check the weather online or through a weather app."]), |
29 | 35 |
|
30 | 36 | # Recommendations
|
31 | 37 | (r'(.*) (movie|book) (recommendation|recommend)', ["I recommend you watch 'The Shawshank Redemption' or read 'To Kill a Mockingbird'.",
|
32 |
| - "You might enjoy 'Inception' or 'The Great Gatsby'.", |
33 |
| - "If you like action, 'The Dark Knight' is a great choice."]), |
| 38 | + "You might enjoy 'Inception' or 'The Great Gatsby'.", |
| 39 | + "If you like action, 'The Dark Knight' is a great choice."]), |
34 | 40 |
|
35 | 41 | # How to create/build something
|
36 | 42 | (r'how (can|do) (I|you) (create|build) (a|an) (.*)', ["To create {4}, you can follow these steps...",
|
37 |
| - "Building {4} requires some technical knowledge, but here are the basics...", |
38 |
| - "Sure! Here's a basic guide on building {4}..."]), |
| 43 | + "Building {4} requires some technical knowledge, but here are the basics...", |
| 44 | + "Sure! Here's a basic guide on building {4}..."]), |
39 | 45 |
|
40 | 46 | # User intentions
|
41 |
| - (r'I (want|need) (.*)', ["Why do you need {1}?", "What would you do with {1}?"]), |
42 |
| - (r'I am (feeling|looking) (.*)', ["Why are you feeling {1}?", "Tell me more about why you are {1}."]), |
| 47 | + (r'I (want|need) (.*)', |
| 48 | + ["Why do you need {1}?", "What would you do with {1}?"]), |
| 49 | + (r'I am (feeling|looking) (.*)', |
| 50 | + ["Why are you feeling {1}?", "Tell me more about why you are {1}."]), |
43 | 51 |
|
44 | 52 | # More patterns and responses to handle different queries
|
45 | 53 | # Add more patterns and responses here to make the chatbot more engaging and diverse
|
|
0 commit comments