Skip to content

Instantly share code, notes, and snippets.

View CliffordAnderson's full-sized avatar

Clifford Anderson CliffordAnderson

View GitHub Profile
@CliffordAnderson
CliffordAnderson / persName.md
Last active April 9, 2026 13:41
Prompt for marking up TEI P5

TEI P5 Named Entity Markup with Wikidata Authority Control You are assisting with the encoding of historical texts in TEI P5 XML. When given a passage of text, identify all personal names and encode them as elements according to the following rules:

  1. Identification Scan the passage for all personal names, including those appearing in inflected, abbreviated, or honorific forms (e.g., genitives, datives, epithets such as heiligen or Bruder).
  2. Wikidata lookup For each identified name, search Wikidata to find the best-matching QID. Use contextual clues in the passage (historical period, location, religious order, profession, associated works or persons) to disambiguate between candidates. Retrieve the entity's preferred English-language label to use as the canonical full name.
  3. Attributes Encode each with the following attributes:

@ref — the full Wikidata URI, e.g. ref="https://www.wikidata.org/wiki/Q63179". Omit if no QID can be identified.

xquery version "3.1";
let $id := "EB010103"
let $doc := fn:collection()/TEI.2[@id = $id]
let $title := ($doc//body/div/head/data())[1]
let $date := $doc//sourceDesc/bibl/date/text()
let $heft := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$1")
let $article := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$2")
let $author := $doc//docAuthor/text()
let $starting-page := $doc//sourceDesc/bibl/biblScope/text() => fn:replace(".*?(\d+)-(\d+)", "$1")
@CliffordAnderson
CliffordAnderson / women-in-religion-llamaindex.ipynb
Last active July 1, 2025 17:07
women-in-religion-llamaindex.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / synthetic-data-generation-of-wikipedia-infoboxes.ipynb
Created June 30, 2025 12:55
synthetic-data-generation-of-wikipedia-infoboxes.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / download-hf-dataset-as-jsonl.ipynb
Created June 30, 2025 12:48
download-hf-dataset-as-jsonl.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / using-pretrained-abstract-to-tweet-model.ipynb
Last active June 30, 2025 12:56
using-pretrained-abstract-to-tweet-model.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / 01-intro.md
Last active February 18, 2025 19:46
Yale Library Coding Meetup

Introduction to Block-Based Programming

Learning Goals

  • Develop facility in block-based programming by creating custom blocks and drawing on the stage.
  • Explore the concept of recursion by encoding the Fibonacci sequence.
  • Understand how block-based programming fosters learning by visualizing units of computation.

A Little Theory

@CliffordAnderson
CliffordAnderson / news-topics.ipynb
Last active December 22, 2025 20:53
news-topics.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / convert-date.xqy
Last active July 17, 2022 01:56
XQuery Puzzles from Week 1, Day 5, Session 4 of the Advanced Digital Editions NEH Institute at the University of Pittsburgh
xquery version "3.1";
let $date := "July 15, 2022"
let $tokens := fn:tokenize($date, " ")
let $month :=
switch ($tokens[1])
case "January" return "01"
case "February" return "02"
case "March" return "03"
case "April" return "04"