This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Span-level LOO threshold analysis for a converged session. | |
| Re-embeds each FIT chunk's ``span_text`` via BGE-M3 ``/embed-all`` and | |
| reports ``T = quantile(LOO_nearest_distances, q)`` at q=0.90 and q=0.95, | |
| plus the full sorted LOO distance distribution. | |
| Counterpart to the production chunk-level pipeline in | |
| ``src/anchor/threshold.py`` — same math, different vectors. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Ubuntu bootstrap: base tools + Docker + Python (deadsnakes) + optional GPU utils + Ollama | |
| # Usage: | |
| # ./bootstrap.sh | |
| # ./bootstrap.sh --with-nvidia --nvidia-version 535 | |
| # ./bootstrap.sh --with-amd | |
| # ./bootstrap.sh --no-snap | |
| # ./bootstrap.sh --no-ollama |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <style> | |
| body { | |
| margin: 0; | |
| padding: 20px; | |
| font-family: Arial, sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(text2vec) | |
| library(stopwords) | |
| library(jsonlite) | |
| library(listviewer) | |
| raw <- read_csv(rstudioapi::selectFile()) | |
| preprocess <- function(x, special_keywords) { | |
| x |> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(highcharter) | |
| raw <- readr::read_rds("sample.rds") | |
| weight = "XXXX" # replace with correct column | |
| vpouch <- raw |> | |
| select(-matches(weight)) |> | |
| names() |> | |
| (\(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import configparser | |
| import sqlite3 | |
| import openai | |
| import pinecone | |
| config = configparser.ConfigParser() | |
| config.read("config.ini") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from getpass import getpass | |
| from pprint import pprint | |
| from neo4j import GraphDatabase | |
| from pymongo import MongoClient | |
| ## get data from document database ---- | |
| mongodb_password = getpass("Enter Atlas password:") | |
| client = MongoClient( | |
| f"mongodb+srv://admin:{mongodb_password}@serverlessinstance0.9vrdx.mongodb.net" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // if x is a multiple of 3 then output "fizz", | |
| // if x is a multiple of 5 then output "buzz" | |
| // if x is a multiple of 15 then output "fizz buzz" | |
| // basic | |
| func fizz_buzz_alpha(max: Int) -> () { | |
| for number in 1...max { | |
| if number % 15 == 0 { | |
| print("fizz buzz") | |
| } else if number % 3 == 0 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(hrbrthemes) | |
| library(janitor) | |
| library(survival) | |
| library(survminer) | |
| library(shiny) | |
| library(miniUI) | |
| theme_set(theme_ipsum()) | |
| pals <- rownames(RColorBrewer::brewer.pal.info) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(networkD3) | |
| raw <- pins::pin_get("projects", "local") | |
| df <- raw %>% | |
| mutate(associate = str_split(associate, pattern = ",|、")) %>% | |
| unnest_longer(associate) %>% | |
| filter(!is.na(associate)) %>% | |
| count(owner, associate) |
NewerOlder