.. qnum::
   :prefix: lab-1a-
   :start: 1

.. highlight:: java
   :linenothreshold: 4


Magpie ChatBot Lab
======================

Lab Requirement
----------------

.. |Magpie Chatbot Lab| raw:: html

   <a href="http://secure-media.collegeboard.org/digitalServices/pdf/ap/ap-compscia-magpie-lab-student-guide.pdf" target="_blank">Magpie Chatbot Lab</a>

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
------------------------------

.. |ELIZA| raw:: html

   <a href="https://web.njit.edu/~ronkowit/eliza.html" target="_blank">ELIZA</a>

.. |ALICE| raw:: html

   <a href="http://www.mfellmann.net/content/alice.html" target="_blank">A.L.I.C.E.</a>

.. |chatbots| raw:: html

   <a href="https://beta.character.ai/" target="_blank">chatbots</a>

1. Working in pairs or groups, try out some chatbots, for example:

   - |ELIZA| the therapist bot from the 1970s:
   - |ALICE| from the 1990s:
   - Modern |chatbots| which use AI and machine learning

2. 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!

3. Ask the chatbot other questions.

   * Record the most interesting response.
   * Record the most peculiar response.

4. 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.

5. **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?

