Skip to content

Instantly share code, notes, and snippets.

View terrymccann's full-sized avatar

Terry McCann terrymccann

  • Palmyra, NY
View GitHub Profile
@terrymccann
terrymccann / classify.py
Last active August 21, 2026 15:26
RFP requirement-extraction pipeline — core extraction code. order of operation 1) segment.py 2) rules.py 3) classify.py
"""Stage 2 — batched classification of DEFER units.
Units are sent as contiguous numbered blocks so each unit doubles as context
for its neighbours (no duplicated context tokens). The returned index set is
validated against the sent index set; a mismatch triggers a batch split and
retry rather than silently losing units.
"""
from __future__ import annotations
import re
@terrymccann
terrymccann / .env
Last active March 30, 2025 15:00
Using LangChain, take a markdown file, chunk it, create embeddings, save it to a pinecone vector store.
OPENAI_API_KEY="your openai api key"
PINECONE_API_KEY="your pinecone api key"
PINECONE_INDEX="name of your pinecone index"