-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.txt
More file actions
109 lines (95 loc) · 5.4 KB
/
Copy pathpython.txt
File metadata and controls
109 lines (95 loc) · 5.4 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import tkinter as tk
from tkinter import scrolledtext
from nltk.chat.util import Chat, reflections
import re
# Define patterns and responses for the chatbot
patterns = [
(r'.hello.', ['Hello! How can I assist you today?', 'Hi there! How can I help you?']),
(r'.admission requirements.', [
"""To apply for admission,
you need to submit your high school transcripts,
standardized test scores, letters of recommendation, and a personal statement."""]),
(r'.program details.', [
"""We offer a wide range of undergraduate and postgraduate programs in various fields,
including business, engineering, arts, and sciences.
To know further please type 'UG' for undergraduate, 'PG' for postgraduate, or 'MED' for medical courses."""]),
(r'.campus life.', [
"""Our campus boasts state-of-the-art facilities,
vibrant student organizations, and a diverse community.
Students enjoy a wide range of extracurricular activities and events throughout the year."""]),
(r'.ug.', [
"""We offer:
Computer Science Engineering - CSE,
Electronics and Communication Engineering - ECE,
Medical courses. To know further,
please type 'CSE' for Computer Science Engineering, 'ECE' for Electronics and Communication Engineering, or 'MED' for medical courses."""]),
(r'.pg.', [
"""We offer:
Master of Business Administration - MBA,
Master of Science - MS. To know further,
please type 'MBA' for Master of Business Administration or 'MS' for Master of Science."""]),
(r'.med.', [
"""We offer:
Bachelor of Medicine and Bachelor of Surgery - MBBS,
Doctor of Pharmacy - PharmD. To know further,
please type 'MBBS' for Bachelor of Medicine and Bachelor of Surgery or 'PharmD' for Doctor of Pharmacy."""]),
(r'.cse.', [
"""We offer a wide range of specializations in CSE such as:
AI/ML, Cybersecurity, DataScience.
To know further, please type the corresponding number of the course."""]),
(r'.ai/ml.', ["Course: AI/ML\nFee: 450000\nDuration: 4 Years"]),
(r'.cybersecurity.', ["Course: Cybersecurity\nFee: 350000\nDuration: 4 Years"]),
(r'.datascience.', ["Course: DataScience\nFee: 350000\nDuration: 4 Years"]),
(r'.mbbs.', [
"Course: Bachelor of Medicine and Bachelor of Surgery (MBBS)\nDuration: 5.5 Years\nEligibility: 10+2 with Physics, Chemistry, and Biology\nEntrance Exam: NEET\nFee: Based on Merit"]),
(r'.pharmd.', [
"Course: Doctor of Pharmacy (PharmD)\nDuration: 6 Years\nEligibility: 10+2 with Physics, Chemistry, and Biology\nEntrance Exam: NEET\nFee: Based on Merit"]),
(r'.mba.', [
"Course: Master of Business Administration (MBA)\nDuration: 2 Years\nSpecializations: Finance, Marketing, HR, etc.\nEntrance Exam: CAT, MAT, XAT, etc.\nFee: 200000"]),
(r'.ms.', [
"Course: Master of Science (MS)\nDuration: 2 Years\nSpecializations: Computer Science, Electronics, etc.\nEntrance Exam: GRE"]),
(r'.ece.', [
"""We offer a wide range of specializations in ECE such as:
Signal Processing, Embedded Systems, Communication Systems.
To know further, please type the corresponding number of the course."""]),
(r'.signal processing.', ["Course: Signal Processing\nFee: 400000\nDuration: 4 Years"]),
(r'.embedded systems.', ["Course: Embedded Systems\nFee: 350000\nDuration: 4 Years"]),
(r'.communication systems.', ["Course: Communication Systems\nFee: 350000\nDuration: 4 Years"]),
(r'.exit.', ['Goodbye! Have a great day.']),
]
# Create a function to generate responses based on user input
def college_admissions_bot():
chatbot = Chat(patterns, reflections)
def send_message(event=None):
user_input = entry.get().lower()
entry.delete(0, tk.END)
response = chatbot.respond(user_input)
conversation.config(state=tk.NORMAL)
conversation.insert(tk.END, "You: " + user_input + "\n", "user")
if response:
response_text = ' '.join(response)
else:
response_text = "I'm sorry, I didn't understand that."
conversation.insert(tk.END, "College Admissions Bot: " + response_text + "\n\n", "bot")
conversation.config(state=tk.DISABLED)
conversation.yview(tk.END)
root = tk.Tk()
root.title("College Admissions Bot")
root.geometry("800x600+300+300") # Adjust dimensions and position as needed
root.configure(bg="#f0f0f0") # Set background color
frame = tk.Frame(root, bg="#ffffff", bd=1, relief="solid")
frame.pack(padx=10, pady=10, fill="both", expand=True)
conversation = scrolledtext.ScrolledText(frame, width=100, height=20, state=tk.DISABLED, font=("Helvetica", 10))
conversation.pack(side=tk.TOP, padx=5, pady=5, fill="both", expand=True)
entry = tk.Entry(frame, width=80, font=("Helvetica", 10))
entry.pack(side=tk.LEFT, padx=5, pady=5, fill="x", expand=True)
send_button = tk.Button(frame, text="Send", command=send_message)
send_button.pack(side=tk.LEFT, padx=5, pady=5)
# Bind the Enter key to the send_message function
root.bind('<Return>', send_message)
conversation.tag_config("user", foreground="blue")
conversation.tag_config("bot", foreground="red")
root.mainloop()
# Main function to run the chatbot
if _name_ == "_main_":
college_admissions_bot()