0% found this document useful (0 votes)
14 views31 pages

Pps Source Code

Uploaded by

mshwetha501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views31 pages

Pps Source Code

Uploaded by

mshwetha501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 31

import nltk

from nltk.chat.util import


Chat, reflections
# Define pairs of patterns and
responses
pairs = [
(r'How do I declare a
major/minor in Computer
Science?',
['To declare a major/minor in
Computer Science, you
typically need to visit the
department office and fill out
a declaration form. The
specific
requirements may vary, so
it\'s best to check with the
department advisor.']),
(r'What are the prerequisites
for specific CS courses?',
['Prerequisites for CS
courses can vary widely. You
can find detailed
prerequisites listed
in the course catalog or on
the department\'s website.']),
(r'How can I change my
major to Computer Science?',
['Changing your major to
Computer
Science usually involves
meeting with an academic
advisor to discuss the
requirements and then
officially submitting a change
of major
form.']),
(r'What are the core courses
for a Computer Science
major?',
['Core courses for a
Computer Science major
typically include programming
fundamentals, data
structures, algorithms,
computer architecture, and
software
engineering.']),
(r'Are there any study abroad
opportunities for Computer
Science students?',
['Yes, many universities offer
study abroad programs for
Computer Science students.
You can inquire with the study
abroad office or the CS
department for more
information.']),
(r'What clubs or
organizations are available
for Computer Science
students?',
['Common clubs and
organizations for CS students
might include ACM
(Association for
Computing Machinery),
coding clubs, hackathons,
and robotics clubs.']),
(r'Can I do research as an
undergraduate student?',
['Yes, many universities offer
opportunities for
undergraduate research in
ComputerScience. You can
reach out to professors or the
department to inquire about
research
positions.']),
(r'How do I get involved in
undergraduate research?',
['To get involved in
undergraduate research, you
can reach out to professors
whose work
interests you, attend
departmental research
seminars, or check the
university\'s research
opportunities database.']),
(r'How do I register for
Computer Science courses?',
['You can register for CS
courses through the
university\'s online
registration system.
Make sure to check for any
prerequisites or
restrictions.']),
(r'Are there prerequisites for
upper-level CS courses?',
['Yes, upper-level CS
courses typically have
prerequisites to ensure
students have the
necessary background
knowledge. Check the course
catalog for specific
requirements.']),
(r'What are the typical class
sizes for Computer Science
courses?',
['Class sizes can vary but are
often smaller for upper-level
courses and
larger for
introductory courses. You can
check the course catalog for
historical enrollment
numbers.']),
(r'How many credits are
required for a Computer
Science major/minor?',
['The number of credits
required for a CS major/minor
can vary by university.
Typically,
it ranges from 30-60 credits
for a minor and 60-120
credits for a major.']),
(r'Are there any honors
courses available?',
['Many universities offer
honors courses for Computer
Science majors. These
courses
often provide more in-depth
study and research
opportunities.']),
(r'Can I take CS courses if
I\'m not a CS major?',
['Yes, many CS courses are
open to students outside the
major. However, priority
registration is often given to
CS majors.']),
(r'How do I find internship
opportunities in Computer
Science?',
['You can find internship
opportunities through
university career fairs, online
job boards,
the CS department, and
networking with professionals
in the field.']),
(r'Are there any career fairs
specifically for CS students?',
['Yes, many universities host
career fairs specifically for CS
students where tech
companies come to recruit.']),
(r'What kinds of jobs do CS
graduates typically pursue?',
['CS graduates pursue a
wide range of careers,
including software
development,
cybersecurity, data analysis,
artificial intelligence, and
more.']),
(r'Do you offer resume
workshops or career
counseling for CS students?',
['Yes, many universities offer
resume workshops, mock
interviews, and career
counseling services
specifically tailored to CS
students.']),
(r'How do I get an advisor in
the CS department?',
['You can typically request an
advisor in the CS department
by contacting the
department office or through
the university\'s online
advisor assignment
system.']),
(r'What are the office hours
for CS professors?',
['Office hours for CS
professors are usually posted
on their department webpage
or
syllabus. You can also find
this information on the
department bulletin board.']),
(r'Can I request a letter of
recommendation from a CS
professor?',
['Yes, you can request a
letter of recommendation
from a CS professor. It\'s best
to ask
well in advance and provide
them with relevant
information about yourself
and your
accomplishments.']),
(r'How do I contact a
professor for
research opportunities?',
['You can email professors
whose research interests
align with yours to inquire
about
research opportunities. Be
sure to express your interest
and attach your resume.']),
(r'Are there any faculty-led
study groups or tutoring
sessions?',
['Some professors or
graduate students may offer
study groups or tutoring
sessions for
specific courses. You can ask
your professors or check with
the
department.']),
(r'What computer labs are
available for CS students?',
['CS students often have
access to dedicated
computer labs with
specialized software.
Check with the CS
department or university IT
services for locations and
hours.']),
(r'How do I get access to
specialized software for CS
courses?',
['Many universities provide
access to specialized
software for CS courses
either throughon-campus labs
or
remote access. Check with
the CS department for
instructions.']),
(r'Are there any workshops
or seminars on specific CS
topics?',
['Yes, universities often host
workshops, seminars, and
guest lectures on various CS
topics. Check the department
calendar or bulletin for
upcoming events.']),
(r'What library resources are
available for CS students?',
['The library may offer
resources such as online
journals, books, and
databases specific
to Computer Science. You
can access these resources
both on-campus and
remotely.']),
(r'Is there a CS lounge or
designated study area?',
['Many universities have a
designated CS lounge or
study area where students
can work
on projects, collaborate, and
study. Check with the CS
department for details.']),
(r'How do I connect to the
university\'s Wi-Fi network?',
['Instructions for connecting
to the university\'s Wi-Fi
network are usually available
on
the IT services website or
provided during orientation.']),
(r'What do I do if I encounter
technical issues with course
software?',
['If you encounter technical
issues with course software,
you can reach out to the
university\'s IT helpdesk for
assistance. They can often
provide troubleshooting
steps.']),
(r'How can I get help with
programming assignments
outside of class?',
['You can seek help with
programming assignments by
attending professor or TA
office
hours, joining study groups,
or utilizing online resources
such as forums and tutorial
websites.']),
]
# Greetings responses
greetings = ["Hello!", "Hi
there!", "Hey!", "Greetings!"]
# Goodbye responses
goodbyes = ["Goodbye!",
"See you later!", "Bye!",
"Farewell!"]
# Random responses for
variety
random_responses = [
"Hmm, interesting question.",
"I'm not sure I understand.",
"Could you please rephrase
that?","That's a good
question.",
"I'll have to think about that
one.",
"I'm sorry, I didn't quite catch
that.",
]
# Create a Chatbot with
defined pairs
chatbot = Chat(pairs,
reflections)
# Start conversation
print("Hi! I'm here to help you
with your questions about
Computer Science. Ask me
anything!")
while True:
user_input = input("You: ")
if user_input.lower() == 'bye':
print("Bot:",
random.choice(goodbyes))
break
elif not user_input.strip():
print("Bot: Please ask me a
question.")
elif user_input.lower() ==
'help':
print("Bot: You can ask me
questions about Computer
Science, such as declaring a
major, finding internships, or
getting involved in research.")
else:
response =
chatbot.respond(user_input)
if not response:
print("Bot:",
random.choice(random_resp
onses))
else:
print("Bot:", response)

You might also like