Tuesday, February 21, 2023

Ethical Questions Related to Discriminative and Generative Artificial Intelligence

It suddenly seems that everyone is talking about artificial intelligence, computers doing things that look like they require intelligence. Tools that generate images or text have gotten fairly good and easy to use.

These generative AI tools are trained to create new content based on their input data sets. Discriminative AI tools, on the other hand, are trained to differentiate among different classes of input and predict which class a new observation should belong to.

My impression is that people are more comfortable with discriminative AI, with applications in autonomous vehicles and facial recognition, than with generative AI that seems to intrude on our uniquely human creativity. Of course there is a spectrum of opinions from excited techno-optimism to worries that this will bring about the end of civilization.

Lately I've been a part of many discussions about ethical questions surrounding artificial intelligence, particularly in education. For many of them there aren't, or aren't yet, good answers, but they certainly make for interesting debate. These are in no particular order, and feel free to use them in your own conversations.

  • Is it plagiarism or cheating to use generative AI tools?
  • Can we accurately detect if students are using these tools? Is this something we should worry about?
  • What are we training students for? Is school about job training?
  • Why do we make students write?
  • What are uniquely human skills and competencies we need to foster?
  • If we block AI tools on our educational networks and devices, does the problem go away?
  • Are we comfortable with doctors or drivers using AI?
  • Can AI take over some of the mundane parts of our jobs (or lives)?
  • How would we feel about a facial recognition attendance system?
  • Is it ethical to have AI help us draft emails, or blog posts?
  • What does education look like if teachers use AI to help generate questions and students use it to help generate answers?
  • Are we okay with corporations using student questions and responses to help train their models?
  • Will bias in the training data lead to increased societal polarization?
  • Are there analogies to historical inventions that we can learn from?
  • Will AI disintermediate students and learning?
  • Does over-reliance on AI lead to skill loss?
  • Will we lose jobs? Will this change jobs?
  • Does AI exacerbate inequality?
  • Will AI lead to homogenization of culture?
  • Do we like spell check, autocorrect, autofill, predictive text, and autoreplies?
  • Will generative AI answers spell the end of internet search?
  • If we enjoy doing things, should we use AI or machines to do those things? Should we try to prevent AI or machines from doing those things?
  • Is AI worth the environmental impact?
  • What might AI tools look like in six months? How about in five years?

Hopefully these questions can help spark some thoughful and spirited discourse.

Saturday, May 7, 2022

Creating, Editing, and Sharing Jupyter Notebooks

I have been working with the Callysto project, which involves fostering computational thinking and data science within the regular curriculum for grades 5 to 12. One of the services provided by Callysto is the Callysto Hub, a free online environment hosting an open-source instance of Jupyter Hub that allows you to run, edit, and create Jupyter notebooks such as these.

While some commercial platforms have good sharing options, there isn't currently a great open-source solution for sharing Jupyter notebooks with collaborators and students. I can show you my current workflow, though, for creating, editing, and sharing Jupyter notebooks.

There are two programs I have installed on the computer in front of me Visual Studio Code for running and editing Jupyter notebooks on this computer and GitHub Desktop for synchronizing with GitHub.

We'll start with GitHub, this is the site used by many software developers to share and collaborate. You'll need to create a free account.

Next we'll use the GitHub Desktop application. Download, install, and run it, then log in with the GitHub account you just created. Now when you visit a GitHub repository, such as Callysto Curriculum Notebooks, you can click the green Code button near the top right of the page and then Open with GitHub Desktop. It should pop you back into the GitHub Desktop program, and you can click the Clone button to download the code from that repository.

To set up Visual Studio Code, download and install it. You'll also need to download and install Python, the VS Code Python Extension, and the VS Code Jupyter extension. You should then be able to open, run, and edit Juypter notebooks, as well as create new ones.

If you encounter errors running notebooks, you likely need to install some Python libraries with commands like !pip install pandas , post in the comments (or reach out on Twitter) for help with that if you need.

At this point you're basically set up, but it gets a little more complicated if you want to share notebooks you create. You'll want to create a new GitHub repository, add your notebook file to that repository folder on your computer, and use GitHub Desktop to commit and push it to GitHub.

Once the notebook file is on GitHub, you can either have your students or colleagues go through this setup process to download your new repository, or you can send them a Callysto nbgitpuller link.

Hopefully that's not too complicated, but feel free to reach out if you have questions or would like help with this.

(Updated for 2022)

Saturday, December 11, 2021

Automatically Changing a YouTube Video's Privacy With Google Apps Script

 Recently we had posted a video that needed to be available during a specific time. The starting availability is taken care of by setting it to premiere. However there's no option for having it unavailable at the end of the time period, so we needed to write some code for that.

Google Apps Script is a good choice for this, since it has a YouTube service that you can enable as well as triggers that can run code at a certain time.

Create a new Apps Script project and paste in the following code:


Then enable the YouTube Service and create a new trigger to run the updateVideoPrivacy function at a time-driven specific date and time. The code will then set your most recently uploaded YouTube video to private at the time you specified.

Saturday, October 30, 2021

Coding Challenge 3

The third coding challenge is up at misterhay.github.io/coding-challenges, along with a possible solution to this challenge and last month's challenge. 

Thursday, September 30, 2021

Small Coding Challenge 2

The second coding challenge is up at misterhay.github.io/coding-challenges, along with a possible solution to this challenge and last month's challenge.

Saturday, September 11, 2021

Fixing a formula in multiple Google Sheets

Recently we realized that there was a calculation error in a Google Sheet template, and unfortunately we had already made a copy of it for each teacher.

Rather than opening each Sheet and manually making the correction, I wrote a Google Apps Script to automatically make the replacements. Here is the code in case it is helpful for anyone else:


function loopThem() {
  var folderId = 'aaaaaaaaa'; // the folder containing all of the sheets to be corrected

  var folder = DriveApp.getFolderById(folderId);
  var files = folder.getFiles();
  while (files.hasNext()) {
    var file = files.next();
    var id = file.getId();
    fixIt(id);
  }
}

function fixIt(id) {
  var rangeToFix = 'P1:P50';  // the range in each sheet that contains the error
  var replaceThis = '$A';
  var replaceWithThis = '$C';

  var ss = SpreadsheetApp.openById(id);
  var range = ss.getRange(rangeToFix);
  var formulas = range.getFormulas();
  for (var i=0; i<formulas.length; i++) {
    var formula = formulas[i][0];
    var newFormula = formula.replaceAll(replaceThis, replaceWithThis);
    formulas[i][0] = newFormula;
  }
  range.setFormulas(formulas);
}

Sunday, August 29, 2021

Small Coding Challenge 1

This year I'm going to design some coding challenges, and hopefully release them at least once a month.

The first coding challenge is up at misterhay.github.io/coding-challenges.