Skip to content

Instantly share code, notes, and snippets.

View rjurney's full-sized avatar

Russell Jurney rjurney

View GitHub Profile
@rjurney
rjurney / company.baml
Created August 16, 2025 06:23
BAML field annotations guide extraction, matching and merging!
class Company {
name string
@description("Formal name of the company with corporate suffix")
...
}
@rjurney
rjurney / settings.json
Created August 10, 2025 07:53
Claude Settings for my Project - do not actually result in autonomically running these commands...
{
"permissions": {
"allow": [
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(git add:*)",
"Bash(git grep:*)",
"Bash(poetry update:*)",
"Bash(pip show:*)",
@rjurney
rjurney / clients.baml
Created August 9, 2025 04:51
LLM Entity Matching + Merging Proof-of-Concept with BAML + Gemini 2.5 Pro
client<llm> Gemini25Pro {
provider google-ai
retry_policy ThreeRetries
options {
model "gemini-2.5-pro"
api_key env.GEMINI_API_KEY
}
}
retry_policy ThreeRetries {
@rjurney
rjurney / clients.baml
Last active August 6, 2025 12:54
BAML for basic information extraction of company records
client<llm> Gemini25Pro {
provider google-ai
retry_policy ThreeRetries
options {
model "gemini-2.5-pro"
api_key env.GEMINI_API_KEY
}
}
retry_policy ThreeRetries {
@rjurney
rjurney / article.baml
Last active August 1, 2025 07:48
BAML Schema for Information Extraction of Companies from News
class NewsArticle {
title string
url string?
@description("URL of the article")
summary string
@description("Summary of the article. What is it about? What are the key points?")
@rjurney
rjurney / results.txt
Created July 17, 2025 11:49
pyspark --packages graphframes:graphframes:0.9.0-spark3.5-s_2.12
Python 3.12.9 | packaged by conda-forge | (main, Mar 4 2025, 22:44:42) [Clang 18.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.0.2 -- An enhanced Interactive Python. Type '?' for help.
Tip: Use `--theme`, or the `%colors` magic to change ipython themes and colors.
25/07/17 21:48:25 WARN Utils: Your hostname, Achilles-3.local resolves to a loopback address: 127.0.0.1; using 10.26.184.245 instead (on interface en0)
25/07/17 21:48:25 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
:: loading settings :: url = jar:file:/Users/rjurney/Software/spark/assembly/target/scala-2.12/jars/ivy-2.5.1.jar!/org/apache/ivy/core/settings/ivysettings.xml
Ivy Default Cache set to: /Users/rjurney/.ivy2/cache
The jars for the packages stored in: /Users/rjurney/.ivy2/jars
graphframes#graphframes added as a dependency
@rjurney
rjurney / CLAUDE.md
Created June 16, 2025 15:03
Example of a `CLAUDE.md` file to tune Claude Code's performance. Refer to it to create your own `CLAUDE.md`

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Install Dependencies: poetry install
  • Run CLI: poetry run abzu
  • Build/Generate abzu/baml_client code: baml-cli generate
  • Test baml_src code: baml-cli test, poetry run pytest tests/
@rjurney
rjurney / loss.py
Created June 13, 2025 02:05
We all contrastive experience loss at some point in our lives, but which one for your problem and with what hyperparameters?
# This will effectively train the embedding model. MultipleNegativesRankingLoss did not work.
loss: losses.ContrastiveLoss = losses.ContrastiveLoss(model=sbert_model)
# These are default arguments for OnlineContrastiveLoss
loss: losses.OnlineContrastiveLoss = losses.OnlineContrastiveLoss(
model=sbert_model,
margin=0.5, # Margin for contrastive loss
distance_metric=SiameseDistanceMetric.COSINE_DISTANCE,
)
@rjurney
rjurney / CLAUDE.md
Created June 3, 2025 16:22
My `CLAUDE.md`, command and allows-tools setup - note that everything has a CLI :) Why not?

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Install Dependencies: poetry install
  • Run CLI: poetry run abzu
  • Build/Generate abzu/baml_client code: baml-cli generate
  • Test baml_src code: baml-cli test, poetry run pytest tests/
@rjurney
rjurney / technical_analysis.md
Created June 1, 2025 04:51
Claude 4 Opus created a technical analysis agent given a DataFrame of tick data for an equity

I'll show you how to structure data and prompts for effective technical analysis with LLMs. Here's a comprehensive approach:

1. Data Preparation Structure

import pandas as pd
import numpy as np
from typing import Dict, List, Tuple

def prepare_ta_data(df: pd.DataFrame) -> pd.DataFrame: