TouchDevelop Turing Test – Creating a chatting robot
This lesson is based on the work of Carrie Anne Philbin for the Raspberry Pi Foundation and is licenced under the Creative Commons Attribution 4.0 International License. (See credits below) |
Suggested time: 100 mins
Learning Objectives:
Curriculum Mapping:
KS2:
KS3:
What you will need:
Introduction:
Can computers think? This was a question posed by computer pioneer and artificial intelligence (AI) theorist, Alan Turing. Turing proposed that, given time, a computer with sufficient computational power would acquire the abilities to rival human intelligence. In order to test his theory, Turing devised a test.
The Turing Test was based on a Victorian parlor game in which a judge (or interrogator) asks a series of questions to a man and a woman in a separate room. By reading a series of typed answers, the judge must determine which replies were from the man and which were from the woman.
Turing adapted the test by replacing the woman with a computer - the aim being to decide whether the answers were from a man or computer thus determining if a computer was able to think for itself.
To find out more about Alan Turing and the Turing Test, click on the links below:
http://www.turing.org.uk - Online biography about Alan Turing
http://en.wikipedia.org/wiki/Alan_Turing - Alan Turing wikipedia page
http://www.bbc.co.uk/history/people/alan_turing - BBC History: Alan Turing
http://en.wikipedia.org/wiki/Turing_test - The Turing Test wikipedia page
http://www.turing.org.uk/scrapbook/test.html - Alan Turing Scrapbook: The Turing Test
Lesson Outline:
In this brief introduction to programming using TouchDevelop, students are going to create a chatting robot (chat bot) designed to confuse the user into thinking that they are talking to a real person.
Starter:
Show the video “Project Natal – Milo demo”. At the end of the video explain to students that for years, science fiction writers and filmmakers have dreamed about robots that can think for themselves however, despite giant leaps in technology, this dream is still far from reality. Explain to students that to explore the reasons why it is so difficult to make a thinking robot, they are going to create their very own chatting robot (chat bot).
Learning Objectives:
- Understand and use sequence in an algorithm
- Understand and use iteration in an algorithm (FOR and WHILE loops)
- Understand and use selection in an algorithm (IF, Else and Else if)
- Understand why it is so difficult to create a computer that can seemingly think for itself
Curriculum Mapping:
KS2:
- Design, write and debug programs that accomplish specific goals; solve problems by breaking them into smaller parts. Select, use and combine a variety of software on a range of digital devices to design and create a range of programs.
- Use sequence, selection and repetition in programs; work with variables and various forms of input and output
- Use logical reasoning to explain how some simple algorithms work; detect and correct errors in algorithms and programs
KS3:
- Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems.
What you will need:
- Web enabled device (PC, Tablet, Phone) with an up-to-date browser (Internet Explorer, Safari, Chrome)
- TouchDevelop Web App (www.touchdevelop.com)
Introduction:
Can computers think? This was a question posed by computer pioneer and artificial intelligence (AI) theorist, Alan Turing. Turing proposed that, given time, a computer with sufficient computational power would acquire the abilities to rival human intelligence. In order to test his theory, Turing devised a test.
The Turing Test was based on a Victorian parlor game in which a judge (or interrogator) asks a series of questions to a man and a woman in a separate room. By reading a series of typed answers, the judge must determine which replies were from the man and which were from the woman.
Turing adapted the test by replacing the woman with a computer - the aim being to decide whether the answers were from a man or computer thus determining if a computer was able to think for itself.
To find out more about Alan Turing and the Turing Test, click on the links below:
http://www.turing.org.uk - Online biography about Alan Turing
http://en.wikipedia.org/wiki/Alan_Turing - Alan Turing wikipedia page
http://www.bbc.co.uk/history/people/alan_turing - BBC History: Alan Turing
http://en.wikipedia.org/wiki/Turing_test - The Turing Test wikipedia page
http://www.turing.org.uk/scrapbook/test.html - Alan Turing Scrapbook: The Turing Test
Lesson Outline:
In this brief introduction to programming using TouchDevelop, students are going to create a chatting robot (chat bot) designed to confuse the user into thinking that they are talking to a real person.
Starter:
Show the video “Project Natal – Milo demo”. At the end of the video explain to students that for years, science fiction writers and filmmakers have dreamed about robots that can think for themselves however, despite giant leaps in technology, this dream is still far from reality. Explain to students that to explore the reasons why it is so difficult to make a thinking robot, they are going to create their very own chatting robot (chat bot).
Activity 1:
Direct students to one of the online chat bots listed below. Instruct students to ask the chat bots a series questions and note down any unusual or unexpected answers.
Note: Some online chat-bots learn from previous conversations. As a result, there may be some cases where what the chat bot says may be deemed as inappropriate. Use these sites at your own risk. TouchDevelop.weebly.com is not responsible for the content of external Internet sites.
Online chat bots:
After a few minutes, stop the class and ask them to feedback their findings to the rest of the class.
Note down some of the students findings and ask the students why they think the chat bot could not answer all of their questions.
Ask the students why you think it is so hard to make a computer appear as if it able to think like a human. Try to draw out answers such as “Computers can only follow a given sequence of instructions” or “Computers can only respond to questions they have been programmed to answer” – give students prompts where necessary.
Explain to students about the Turing Test (insert link to wikipedia) and discuss the concept of Artificial Intelligence (AI). Finally, inform students that they are going to create a chatting robot (chat bot) and that there will be a prize for the most convincing robot (the prize is optional).
Activity 2:
Click on the link below and follow the instructions on how to create your own chat bot:
Tutorial:
TouchDevelop Turing Test - Creating a Chatting Robot (step-by-step tutorial)
Worksheet:
Direct students to one of the online chat bots listed below. Instruct students to ask the chat bots a series questions and note down any unusual or unexpected answers.
Note: Some online chat-bots learn from previous conversations. As a result, there may be some cases where what the chat bot says may be deemed as inappropriate. Use these sites at your own risk. TouchDevelop.weebly.com is not responsible for the content of external Internet sites.
Online chat bots:
- Evie (recommended!) - http://www.existor.com
- Jabberwacky - http://www.jabberwacky.com
- Brain Bot - http://www.botlibre.com/chat.jsp
- SkyNet Ai - http://home.comcast.net/~chatterbot/bots/AI/SkynetV5/
- Clever Bot - http://www.cleverbot.com
After a few minutes, stop the class and ask them to feedback their findings to the rest of the class.
Note down some of the students findings and ask the students why they think the chat bot could not answer all of their questions.
Ask the students why you think it is so hard to make a computer appear as if it able to think like a human. Try to draw out answers such as “Computers can only follow a given sequence of instructions” or “Computers can only respond to questions they have been programmed to answer” – give students prompts where necessary.
Explain to students about the Turing Test (insert link to wikipedia) and discuss the concept of Artificial Intelligence (AI). Finally, inform students that they are going to create a chatting robot (chat bot) and that there will be a prize for the most convincing robot (the prize is optional).
Activity 2:
Click on the link below and follow the instructions on how to create your own chat bot:
Tutorial:
TouchDevelop Turing Test - Creating a Chatting Robot (step-by-step tutorial)
Worksheet:
chat_bot_tutorial.docx |
Extension
- Challenge 1: There is a problem with our code. The code in TouchDevelop is case sensitive therefore, if we were to type in "Good" (Uppercase G) instead of "good" in response to the question "How are you feeling?" TouchDevelop will not find a match and will therefore reply with "I'm sorry to hear that!". In order to get around this problem, we can convert the users reply to lower case using the `to lower case` command. Up date your code as follows:
- At the moment, we only have two responses to the question "How are you feeling?" Add some more responses to make the chat bot appear more realistic. For example:
- In TouchDevelop you can use the in-built text to speech facility to speak your questions. To do this we use the 'Languages' function. Add some speech in your code to make it look as if the chat bot is talking. For example:
Plenary:
Direct students to swap places with a partner or person next to them and try out their chat bot. Instruct the students to suggest at least one improvement using the comment facility in TouchDevelop. (Insert screenshot). After a few minutes, ask the students to return to their seats and make any suggested improvements.
As an extra incentive, you could offer a prize for the most convincing chat bot (almost like a mini Loebner Prize - http://en.wikipedia.org/wiki/Loebner_Prize) However, rather than rewarding the students with $6,000 for creating the most convincing chat bot, I suggest some chocolate instead!
Homework:
Students can continue to work on their chat bot and publish their script when they have finished.
Credits:
This is lesson is an adaptation of the Turing Test lessons created for the Rasberry Pi by Carrie Anne Philbin. To see the original resources, click here: Raspberry Pi Foundation – Turing Test lessons (http://www.raspberrypi.org/learning/turing-test-lessons/)
Licence:
Unless otherwise specified, everything in this repository is covered by the following licence:
TouchDevelop Turing Test is licenced under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/raspberrypilearning/turing-test-lessons
Based on a work at https://github.com/raspberrypilearning/turing-test-lessons