|
Buy:
|
NLP: Chatting Robot
Note: Lesson plan and resources for this activity can be found at the bottom of this page.
Overview
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 parlour 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:
The Turing Test was based on a Victorian parlour 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:
- https://www.turing.org.uk - Online biography about Alan Turing
- https://en.wikipedia.org/wiki/Alan_Turing - Alan Turing wikipedia page
- https://www.bbc.co.uk/history/people/alan_turing - BBC History: Alan Turing
- https://en.wikipedia.org/wiki/Turing_test - The Turing Test wikipedia page
- https://www.turing.org.uk/scrapbook/test.html - Alan Turing Scrapbook: The Turing Test
Natural Language Processing (NLP)
|
Natural language processing (NLP) refers to the branch of computer science—and more specifically, the branch of artificial intelligence (or AI)—concerned with giving computers the ability to understand text and spoken words in much the same way humans can.
Chatbots A chatbot is a computer program that simulates and processes human conversation (either written or spoken), allowing humans to interact with digital devices as if they were communicating with a real person. Have you ever wondered why chatbots are created? They are meant to make it feel as if we are talking to a real human because this is what we are comfortable with. |
Lesson Plan
Lesson Plan: Chatting Robot
Creating a Machine Learning Sentiment Analysis Bot
This lesson is aligned with the National Curriculum in England: Secondary Curriculum (Key Stage 2/3), Curriculum for Wales (Digital Competence Framework), ISTE standards for students, and CSTA K-12 CS standards.
Overview
In this lesson, students will create a chatting robot using machine learning and NLP.
Learning Objectives
Materials Needed
Curriculum Mapping
Creating a Machine Learning Sentiment Analysis Bot
This lesson is aligned with the National Curriculum in England: Secondary Curriculum (Key Stage 2/3), Curriculum for Wales (Digital Competence Framework), ISTE standards for students, and CSTA K-12 CS standards.
Overview
In this lesson, students will create a chatting robot using machine learning and NLP.
Learning Objectives
- Understand the basic principles of machine learning and its applications
- 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)
- Develop skills in creating and training a machine learning model.
- Create an NLP chatbot using Scratch and machinelearningforkids.co.uk.
Materials Needed
- Computers with internet access
- Access to machinelearningforkids.co.uk
- Scratch 3 (online version via machinelearningforkids.co.uk)
- Projector and screen for demonstration
- Handouts with step-by-step instructions (see resources below)
Curriculum Mapping
KS2 Computing:
- Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.
- 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 and to detect and correct errors in algorithms and programs.
KS3 Computing:
- Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems.
- Make appropriate use of data structures [for example, lists, tables or arrays].
Science and Technology AoLE (Computation is the foundation for our digital world):
- Progression Step 3: "I can use conditional statements to add control and decision-making to algorithms." and "I can identify repeating patterns and use loops to make my algorithms more concise."
- Progression Step 4: "I can decompose given problems and select appropriate constructs to express solutions in a variety of environments."
Digital Competence Framework (DCF):
- Producing: The lesson involves planning and creating digital content (a program) and then evaluating and improving it.
- Data and computational thinking: This is the core of the lesson, focusing on problem-solving, modeling a concept (happiness) with data, and understanding how algorithms work.
1.4 Innovative Designer:
- Students use a variety of technologies within a design process to identify and solve problems by creating new, useful, or imaginative solutions.
1.5 Computational Thinker:
- 5c: Students break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.
- 5d: Students understand how automation works and use algorithmic thinking to develop a sequence of steps to create and test automated solutions.
Algorithms and Programming (AP):
- 1B-AP-09: Create programs that use variables to store and modify data.
- 1B-AP-10: Create programs that include sequences, events, loops, and conditionals.
- 1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
- 1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
- 2-AP-11: Create clearly named variables that represent different data types and perform operations on their values.
- 2-AP-12: Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals.
Lesson Outline
Starter (10 mins)
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. TeachwithICT.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 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).
Introduction (10 mins)
Introduce the concept of Natural Language Processing (See description above) and it's applications in everyday life (e.g., virtual assistants, translation tools, predictive text etc.).
Inform the students that they will be creating an NLP-powered chatbot, using an experimental version of Scratch and machine learning techniques.
Hands-On Activity (30 mins)
Plenary (10 mins)
Direct students to swap places with a partner or person next to them and try out their chat bot. Instruct the students to leave a comment in their partner’s code suggesting at least one improvement. 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 - https://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!
Assessment Criteria
Starter (10 mins)
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. TeachwithICT.weebly.com is not responsible for the content of external Internet sites.
Online chat bots:
- Evie (recommended!) - https://www.existor.com
- Jabberwacky - https://www.jabberwacky.com
- Brain Bot - https://www.botlibre.com/chat.jsp
- SkyNet Ai - https://home.comcast.net/~chatterbot/bots/AI/SkynetV5/
- Clever Bot - https://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 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).
Introduction (10 mins)
Introduce the concept of Natural Language Processing (See description above) and it's applications in everyday life (e.g., virtual assistants, translation tools, predictive text etc.).
Inform the students that they will be creating an NLP-powered chatbot, using an experimental version of Scratch and machine learning techniques.
Hands-On Activity (30 mins)
- Direct students to machinelearningforkids.co.uk and have them click on 'try it now'.
- Guide students through creating a machine learning project that recognises text.
- Share the instructions for creating an AI chatbot (below) and challenge students to create their own chatbot on a topic of their choice.
- Once the training is complete, have students test their model using the examples they supplied and new ones.
Plenary (10 mins)
Direct students to swap places with a partner or person next to them and try out their chat bot. Instruct the students to leave a comment in their partner’s code suggesting at least one improvement. 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 - https://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!
Assessment Criteria
- Understanding of machine learning concepts and applications.
- Ability to create and train a machine learning model with appropriate examples.
- Successful creation of an NLP chatbot using Scratch.
Step-by-step instructions:
| chatbot_worksheet__scratch_.pdf |