import pandas as pd # -------------------------------------------------- # 1. Extended chatbot dataset # -------------------------------------------------- data = { "keywords": [ "hello|hi|hey|greetings", "name|school name|your name|about school", "principal|head|headmaster|headmistress", "where|location|situated|address|place|map", "time|timing|hours|school hours|opening time|closing time", "admission|admissions|apply|register|registration|admission form", "subject|subjects|stream|course|courses|options", "teacher|teachers|staff|faculty", "exam|test|examination|assessment|unit test", "library|books|reading room|digital library", "sports|game|games|playground|activities|athletics", "lab|laboratory|labs|science lab|computer lab|robotics lab", "transport|bus|school bus|transportation|route", "holiday|vacation|holidays|break|summer break|winter break", "canteen|food|lunch|snacks|cafeteria", "uniform|dress code|school uniform", "contact|phone|email|call|reach|contact number", "fee|fees|fee structure|school fee|charges", "event|events|function|functions|annual day|program|celebration", "achievement|achievements|award|awards|rank|trophy|win", "motto|mission|vision|goal|objective", "facility|facilities|amenities|infrastructure|campus", "smart class|digital class|smart board|projector", "hostel|boarding|residential", "attendance|absence|present|absent", "result|results|marks|report card", "rules|regulations|discipline|policy", "transport fee|bus fee|route fee", "extra class|tuition|coaching|remedial", "cultural activities|dance|music|art|craft", "counsellor|counselling|psychologist", "computer|it|technology|coding|programming", "security|cctv|safety|guards", "medical|sick room|nurse|first aid", "playground|sports ground|field", "admission criteria|eligibility|age criteria", "online class|virtual class|zoom|google classroom", "parent meeting|ptm|parent-teacher meeting", "scholarship|merit|financial aid", "school history|established|foundation|year started" ], "response": [ "Hello! I’m your virtual assistant. How may I help you today?", "This is MDK Arya Senior Secondary School, a reputed institution in Pathankot established in 1985 with excellent academic and co-curricular facilities.", "Our respected Principal is Mr. Jeevan V.K., a visionary leader with 25+ years of experience in education.", "The school is located in Siali Road, Pathankot. It is easily accessible by bus, autos and cab services.", "School hours are 8:00 AM to 2:00 PM (Mon–Sat). Saturday classes end at 12:30 PM.", "Admissions are open from March to September. Forms are available at our reception. Entrance tests apply for higher classes.", "We offer Science, Commerce, and Humanities streams with subjects like PCM, PCB, Accountancy, Economics, Political Science, Psychology, CS, and more.", "We have 60+ qualified teachers who focus on conceptual understanding, discipline, and overall student growth.", "We conduct unit tests, mid-term exams, and final exams following the CBSE curriculum. Continuous assessments are also included.", "Our library has 12,000+ books, magazines, newspapers, e-books, and digital learning material for all students.", "We offer football, cricket, basketball, badminton, table tennis, athletics, yoga, and indoor games. Sports competitions occur yearly.", "We have fully equipped labs for Physics, Chemistry, Biology, Computer Science, Robotics, and Mathematics.", "We don't provide bus service but student come through auto rickshaws and other modes", "We observe all national holidays. Summer break is mid-May to June; winter break is late December to early January.", "Our canteen provides hygienic snacks, lunch, juices, and healthy meal options for all students.", "Our uniform includes white shirts with grey trousers/skirts. Wednesday is house-uniform day for activities.", "You can reach us at 0186-5082705 or email us at mdkschool@rediffmail.com Website: www.mdkaryaschool.com", "Fees vary based on the class/stream. Full fee structure is available at the accounts office and on our website.", "We host annual day, cultural fests, science exhibitions, sports meets, and various competitions every year.", "We have won multiple awards in academics, environmental initiatives, debate, robotics, and sports at district and national levels.", "Our motto is 'Knowledge is Power'. Our mission is to build confident, creative, and responsible lifelong learners.", "Facilities include smart classrooms, computer labs, science labs, library, Wi-Fi, playground, CCTV, and activity rooms.", "All classrooms are equipped with smart boards, projectors, and digital learning tools for better understanding.", "Currently, we do not offer a hostel facility. We are a day-school only.", "Attendance is monitored daily. Parents receive alerts for absences via SMS.", "Results are shared through report cards and also posted on the student portal.", "We follow strict discipline policies ensuring respect, punctuality, and safety.", "Transport fee varies based on routes. Details available at the transport office.", "Remedial and extra classes are conducted for students who need additional support in key subjects.", "We offer dance, music, art, craft, drama, and cultural activities as part of co-curricular education.", "We have a trained counsellor available for student mental well-being and career guidance.", "We teach computer science, coding (Python, HTML, Java), robotics, IT skills, and digital literacy.", "The school has full CCTV coverage, security guards, and a strict visitor verification system.", "We have a dedicated medical room with a trained nurse and basic first-aid facilities.", "A large playground and sports field are available for outdoor sports and physical education.", "Admission eligibility depends on class and age. Details are mentioned in the admission brochure.", "We conduct online classes during emergencies using Zoom/Google Classroom.", "Parent-Teacher Meetings (PTMs) are held regularly to discuss academic performance and development.", "Scholarships are provided to merit-based and economically weaker students.", "The school was established in 1985 and has grown into one of the top CBSE schools in the region." ] } # Convert to DataFrame df = pd.DataFrame(data) # -------------------------------------------------- # 2. Chatbot interaction # -------------------------------------------------- print("Welcome to MDK Arya Senior Secondary School Chatbot!") print("You can ask me anything about our school.") print("Type 'bye' anytime to end the chat.") print("------------------------------------------------") while True: user = input("You: ").lower() if "bye" in user: print("Chatbot: Goodbye! It was nice talking to you. Have a great day!") break matched = False for index, row in df.iterrows(): if any(keyword in user for keyword in row['keywords'].split("|")): print("Chatbot:", row['response']) matched = True break if not matched: print("Chatbot: Sorry, I’m still learning. Please ask something related to school information.")