Skip to content

Instantly share code, notes, and snippets.

@shawngraham
shawngraham / gist:c4101bc2246ca9e01558323fab0900a1
Created November 20, 2023 16:28
Generated through discussion with a gpt trained on several volumes of material related to the logic of harris matrices, this file represents the gpt's best attempt at representing the conventions of a harris matrix via mermaid.js . There is no text-based specification explicitly for harris matrices, to my knowledge, so this is a kind of band-aid…
# Stratigraphic Representation with Mermaid.js: A Guide to Conventions
This document outlines a set of conventions for representing complex stratigraphic sequences using Mermaid.js diagram syntax. The aim is to provide a standardized approach to visualize archaeological stratigraphy in a clear and comprehensible manner.
## 1. Superposition
@shawngraham
shawngraham / BR(1).csv
Last active November 17, 2023 16:50
conversation with archaeo analyst gpt
Site DLH-1 DLH-2a DLH-2b DLH-2c DLH-4
Atsinna 16 9 3 0 1
Cienega 13 3 2 0 0
Mirabal 9 5 2 5 0
PdMuertos 14 12 3 0 0
Hesh 0 26 4 0 0
LowPesc 1 26 4 0 0
BoxS 0 11 3 13 0
Ojo Bon 0 0 17 0 16
S170 0 0 18 0 14

Generate a harris matrix from this section drawing of a feature.

GPT ->

To generate a Harris Matrix from the provided section drawing of an archaeological feature, I will identify the stratigraphic layers and their relationships as depicted. This process involves interpreting the drawing to understand the sequence of events that each layer represents.

From the image, we can see several distinct layers, each with unique characteristics. Here's a description of the layers and their immediate stratigraphic relationships as they appear:

  • The light gray gravel and sand at the topmost layer.
import ijson
import json
import openai
# Add the necessary import statement for the LLM API
import llm #
openai.api_key = "key goes here"
def rewrite_caption(caption):
@shawngraham
shawngraham / extract.yaml
Created October 24, 2023 15:14
template for using with llm
system: 'You are an excellent natural language processor. Extract entities and relationships from the $input.'
prompt: 'Extract entities as indicated in the pattern, and ONLY predicates as indicated in the pattern. Return subject, predicate, object triples, ONLY ACCORDING to entity types and relationships in this pattern:
erDiagram
AUCTIONHOUSE ||--o{ ARTIFACT : auctions
AUCTIONHOUSE ||--o{ PERSON: sells_to
AUCTIONHOUSE ||--o{ MUSEUM: sells_to
MUSEUM {
string name
string city
string country
@shawngraham
shawngraham / antiquities-gpt4-improved.ttl
Last active September 20, 2023 20:39
I asked gpt4 to improve the antiquities.ttl ontology. This was its suggestion: 1. Created an `ex:POSSESSOR` class which is the subclass of `ex:PERSON`, `ex:GALLERY`, and `ex:MUSEUM` and set that as the domain for `ex:has_possession_of`. 2. Merged `ex:buys` and `ex:obtains_from` into `ex:acquires` and `ex:works_with` and `ex:spouse_of` into `ex:h…
@prefix ex: <#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# Classes
ex:ENTITY rdf:type rdfs:Class .
ex:OWNER rdf:type rdfs:Class ;
@shawngraham
shawngraham / config.ts
Created August 16, 2023 19:13
my settings for AI Town, in an attempt to create a gpt powered version of my defunct twitter bot @tinyarchae, scenes from the world's most dysfunctional excavation project. AI Town: https://github.com/a16z-infra/ai-town
// How close a player can be to have a conversation.
export const NEARBY_DISTANCE = 4;
// Close enough to stop and observe something.
export const CLOSE_DISTANCE = 2;
// How long it takes a player to walk one tile.
export const TIME_PER_STEP = 2_000;
// After this many ms, give up on the agent and start thinking again.
export const AGENT_THINKING_TOO_LONG = 600_000;
// How long to hang out if there was no path to your destination.
export const STUCK_CHILL_TIME = 30_000;
@shawngraham
shawngraham / antiquities.ttl
Last active August 10, 2023 19:05
an ontology for the illicit antiquities trade
@prefix ex: <#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# Classes
ex:AUCTIONHOUSE rdf:type rdfs:Class .
ex:ARTIFACT rdf:type rdfs:Class .
ex:PERSON rdf:type rdfs:Class .
ex:MUSEUM rdf:type rdfs:Class .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix ex: <http://example.org/ontology#> .
# Classes
ex:IllegalAntiquitiesTrade rdf:type owl:Class ;
rdfs:label "Illegal Antiquities Trade" ;
rdfs:comment "The trade involving the buying and selling of artefacts that may have been stolen or looted from galleries, museums, auction houses, archaeological sites, or personal collections." .
  • having good interlinkages and tags increases the likelihood of you finding a journey between any pair of notes
  • study your graph to find interesting start/end note pairs
  • which notes might help you answer 'what is the most powerful thing you've learned in this course'.
  • which notes might help you answer if you got what you wanted out of this course, and if not, why not. 'Because Graham didn't...' is not an acceptable answer. This question is for you to reflect on how you took advantage or not of the opportunities afforded to you here.
  • run the journey plugin
  • have its settings so that include tags is turned on, take the scenic route is on, and enable automatic linking turned on.
  • create your new note 0_Final Journey_1 and 0_Final Journey_2 for your responses.
  • make sure all linked notes are in the online memex

... remember you can also use the ![[name of note ^ paragraph]] syntax to embed paragraphs from your notes into your discussion.