January 2, 2023

NLP Modules for High School

IFML member Greg Durrett developed an eight-lesson IFML high-school teaching module that introduces students to Natural Language Processing (NLP).

NLP Module

IFML is committed to broadening participation and engaging women and underrepresented communities in the fields of machine learning and artificial intelligence. To that effort, IFML member Greg Durrett developed an eight-lesson IFML high-school teaching module that introduces students to Natural Language Processing (NLP). The lessons are short, professionally recorded lectures that are accompanied by a project to be done by the teacher and students to expand the existing HS curriculum.

These are videos and brief assignments meant to serve as an NLP "module" appropriate for use in a high school setting, or as a first introduction to NLP for any audience with some prior programming exposure (ideally in either Java or Python).

Please see our Overview of the module for instructors (PDF) for an introduction to what this module is and how you might use it. For a brief slide overview, visit this presentation (PDF)

What instructors are saying:

“The most useful part of this module was the student interest. Students thoroughly enjoyed getting the Transformer language model to write sentences and enjoyed setting up contexts to try to predicate and manipulate what the sentence would contain."

"The videos were very helpful in explaining the concepts of NLP and ML. The coding module was useful in seeing the concepts described in the video in action."

“It was a good introduction to NLP which most of my students were unfamiliar with. It also helped tie in math and statistics with computer science. The fact that there were both Python and Java examples was helpful because most of my classes learn Java but my AP CS Principles class has been using Python.”

Slides

Aggregated slides (PDF); I use these for a 75-minute version of this material. (Presented at the UT summer academies)

Videos (YouTube Playlist)

Videos Materials
1 What is NLP?  
2 Machine Learning  
3 Language Modeling  
4 Building n-gram Language Models Exercise 0: Understanding Language Models
5a Bigram LM Code (Java) Code (tgz) | Code in Replit
5b Bigram LM Code (Python) Code (tgz) | Code in Replit
6a Querying the LM (Java) Exercise 1: Bigram LM (Java)
6b Querying the LM (Python) Exercise 1: Bigram LM (Python)
7 Hands-on: Write With Transformer Exercise 2: Write With Transformer
8 Discussion: Write With Transformer  
9 Language Models in the News  
10 What's Next