Skip to content

Instantly share code, notes, and snippets.

View stevecassidy's full-sized avatar

Steve Cassidy stevecassidy

View GitHub Profile
@stevecassidy
stevecassidy / migrate-notebook.py
Last active August 11, 2023 07:15
Migrate a FAIMS3 notebook from the original format
# Copyright 2021, 2022 Macquarie University
#
# Licensed under the Apache License Version 2.0 (the, "License");
# you may not use, this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
@stevecassidy
stevecassidy / checkout.py
Created October 23, 2019 07:30
Checkout student submissions from Github Classroom
"""Check out student submissions for an assignment"""
# driven by two csv files:
# - export from GitHub Classroom roster containing
# identifier, github_username, github_id, name
# - export from iLearn containing
# 'Email address', 'ID number'
#
# input classroom name and assignment name
# then checks out one repository per student into a directory
@stevecassidy
stevecassidy / ciara_import.py
Created June 3, 2019 01:00
Import CIARA corpus data into Alveo
import pyalveo
import re
import os
# map file extensions to Alveo media type names for metadata
EXT_MAP = {
'.wav': "Audio",
'.txt': "Text",
'.mp4': "Video"
}
@stevecassidy
stevecassidy / xml2text.py
Created July 27, 2018 00:56
Script to convert single large XML export from NLA Trove into single files.
"""
Author: Steve Cassidy (Steve.Cassidy@mq.edu.au)
Script to convert XML export from Trove into single files.
The XML export from Trove consists of a single XML file with many
<article> elements, one per article. Since an export file can be very
large this makes processing the data hard. This script breaks the
large file into many small files that could then be fed to
later processes. Each file is named for the article id number
@stevecassidy
stevecassidy / get_maptask_data.py
Created March 22, 2018 23:28
Script to download Austalk maptask data from Alveo.
"""
Script to identify and download maptask recordings from Austalk using
the Alveo API.
Author: Steve Cassidy
This script takes as input a spreadsheet (CSV) of participant data
created by the austalk-query app at https://austalk-query.apps.alveo.edu.au/.
On that app, use the first page to select the speakers you want via their
@stevecassidy
stevecassidy / README.md
Created December 10, 2017 10:44 — forked from fogonwater/README.md
Demonstration of how I start d3 projects.

A d3.js starter template.

This is the little bit of scaffolding I typically use when starting a d3.js project. I typically separate the Javascript from the HTML, but it's included here for convenience. In addition to d3.js v4, this example uses the following additional libraries.

Block here: bl.ocks.org/fogonwater/a299c3ea7f4f1fea6ee5eda061113430

@stevecassidy
stevecassidy / get_prompts.py
Created November 2, 2017 03:07
Get prompts for Austalk items stored in Alveo using a SPARQL query
"""
Author: Steve Cassidy
Date: 2/11/2017
Query the Alveo SPARQL API for information about the prompt
for an item list taken from the Austalk collection.
This should be in the item metadata but due to an error in the ingest
it was lost, however it is still stored in the RDF metadata since
there is a link from each item to it's 'prototype' in the protocol
@stevecassidy
stevecassidy / Sentiment.ipynb
Last active July 10, 2017 04:43
An experiment in using sentiment analysis to examine bias in newspaper text.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevecassidy
stevecassidy / austalk_speaker.ttl
Created March 17, 2017 03:07
Sample speaker metadata from the Austalk corpus that can be queried via SPARQL
@prefix alveo_austalk_ns: <http://app.alveo.edu.au/catalog/austalk/> .
@prefix ausnc: <http://ns.ausnc.org.au/schemas/ausnc_md_model/> .
@prefix austalk: <http://ns.austalk.edu.au/> .
@prefix dbp: <http://dbpedia.org/ontology/> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix graf: <http://www.xces.org/ns/GrAF/1.0/> .
@prefix id_ns: <http://id.austalk.edu.au/> .
@prefix iso639: <http://downlode.org/rdf/iso-639/languages#> .