Magpie ChatBot Lab¶
Lab Requirement¶
As of 2014-2015 the Advanced Placement Computer Science A course must include at least 20 hours of hands-on labs. In 2014, 3 recommended labs were created, Magpie, Picture, and Elevens, and in 2019-20, 4 more labs were created, Consumer Review, Steganography (an extension of PictureLab), Celebrity, and Data. Your teacher may choose to do any of these labs or their own labs to complete at least 20 hours of labs. See https://apcentral.collegeboard.org/courses/ap-computer-science-a/classroom-resources/lab-resource-page for the student guides for each of these labs.
If your class does all or part of the Magpie Lab, here is the College Board student guide for the Magpie Chatbot Lab as a pdf. Your teacher will provide the lab code for you which is also in the next pages. The particular code in each of these labs will not be on the exam, but the concepts covered by the labs will be on the exam.
Magpie Lab Description¶
The Magpie lab allows you to work with the String
class and conditionals with a chatbot. A chatbot is a computer program that tries to hold a conversation with a user. This chapter will walk you through the activities in the Magpie chatbot lab.
The first activity in Magpie is to explore some existing chatbots. We encourage you to work in pairs or groups on this activity.
Activity 1: Exploring Chatbots¶
Working in pairs or groups, try out some chatbots here.
Record the chatbot response to each of the following.
Where do you come from?
asdfghjkl;
My mother and I talked last night.
The weather is nice.
I said no!
Ask the chatbot other questions.
Record the most interesting response.
Record the most peculiar response.
Work with another student or group to have two chatbots chat with each other. Type the responses from one chatbot into the input area for the other and vice-versa.
Keywords: Some chatbots look for particular keywords and respond based on those keywords. What are some of the keywords that your chatbot seems to be responding to? Why do you think it responds to those keywords?