Lab #1 Solution

$30.00

Description

Objectives

  • Python programming & environments

  • Agents

  • Chatbots

Important: Labs are to be completed individually. Do not collaborate with anyone in completion of this assignment.

Do not post solutions, code, or these questions online, or make them accessible outside of this course.

I. Welcome to Python

Task

This course will require some Python programming – and this might be a new language to you. Now is the time to familiarize yourself with basic syntax and to explore the development environments available.

Details

The VDI will have a complete installation, however it is often helpful to have your own system set up as well. No time like the present!

1. Install Python 3.6 https://www.python.org/downloads/

  1. Install Anaconda 5+https://www.anaconda.com/download

3. Install TextBlob: http://textblob.readthedocs.io/en/dev/install.html

New to Python? Take this time to try out basic Python programming. CodeAcademy provides a great interactive tutorial: https://www.codecademy.com/learn

If Anaconda is new to you, a helpful cheatsheet has been provided on Blackboard (Content > Resources > Anaconda-cheatsheet.pdf).

In your applications (Start Menu, LaunchPad, etc), open Anaconda Navigator and browse your new Python-related applications. This semester you may use any IDE, I recommend Spyder. Note that Python 3.5 will not be sufficient for some future assignments – please ensure you are using 3.6.

Rubric

(0 points) – Nothing will be turned in for this portion of the lab.

However, we will assume you are ready to begin to code in Python.

II. Basic Chatbots

Task

Now that you’re familiar with Python, write a short program – a [very] basic chatbot! It won’t be passing the Turing test any time soon, but it’s a good warm-up for this course.

Details

Your bot must recognize some greetings (such as “hi”, “hello”) and respond to basic questions (such as “how are you?”). Upon running your python program, your chatbot will wait for user input, then respond to each input until the keyword “bye” is entered. The output must look similar to what is shown in this sample conversation:

*******************************

Welcome to Rowdy Messenger

*******************************

<<<type “bye” to exit>>>

You: Hello

Bot: Hi there

You: What’s up?

Bot: Just talking with you!

You: Cool!

Bot: Not really

You: bye

Bot: See ya next time

rowdy-messenger.py

Running this file will run your chatbot – its sole purpose should be to show the welcome/instructions and launch the chatbot. When you’re done talking with the bot, it will stop the program.

chatbot.py

This file will contain all logic for your chatbot. It will store all recognized expressions and responses, and contain a method for determining what response to return based upon a user’s input. It should choose randomly if it has more than one correct response to user input.

Rubric

(10 points) Requirements – zip file and python files properly named, all chatbot logic is in chatbot.py, submission adheres to requirements.

(10 points) Comments – Both .py files have a header comment containing your full name and abc123. Code in both files is easy to read and is commented.

(50 points) Correctness – Chatbot functions as described, with different responses to different types of interactions (i.e.: greetings versus questions). (-70 points) Any inappropriate submissions will receive 0 credit for this portion of the lab.

III. PEAS

Submit your answers to the following questions in a file named Lab1-Question3.pdf.

Your full name and UTSA ID must appear at the top of the page.

  1. (15 points) Complete the following table describing the task environments for the given four tasks. Leverage the terminology reviewed in class and in your textbook.

Self-driving shuttle Attending a lecture

Image analysis

Crossword puzzle

Observable

Deterministic

Episodic

Static

Discrete

Single-agent

2. (15 points) What are the P.E.A.S. for a medical diagnostic system?

Submission

On Blackboard, submit a zip file named abc123-lab1.zip containing only:

  • rowdy-messenger.py

  • chatbot.py

  • Lab1-Question3.pdf

3