Skip to content

Instantly share code, notes, and snippets.

View santhoshtr's full-sized avatar
👷‍♂️
Work in progress

Santhosh Thottingal santhoshtr

👷‍♂️
Work in progress
View GitHub Profile
@santhoshtr
santhoshtr / fetch-mteb.py
Created October 9, 2026 08:03
Rebuild the MTEB leaderboard's per-language table, with languages it does not show
"""Rebuild the leaderboard's per-language table, with languages it does not show.
The leaderboard hardcodes a 20-language `language_view`, which is why Malayalam
is absent. The aggregation itself is language-agnostic: explode the per-subset
scores, group by (model, language), take the mean. So asking for more languages
is a matter of passing a longer list.
"""
import sys, time
from pathlib import Path
import polars as pl
@santhoshtr
santhoshtr / triplet.py
Created October 9, 2026 08:01
Malayalam sample embedding dataset - Rank-based probe: does the positive outrank every negative?
"""Rank-based probe: does the positive outrank every negative?
No absolute cosine threshold is used anywhere. Only the order matters, so the
result is comparable across models that have different similarity scales.
"""
import sys, torch, numpy as np
from sentence_transformers import SentenceTransformer
BASE = "ആനപ്പുറത്തു കയറി"
POS = "ആനയുടെ പുറത്തു കയറി"
@santhoshtr
santhoshtr / plot-mteb.py
Created October 9, 2026 08:00
MTEB Leaderboard for Indic languages
#!/usr/bin/env python3
"""Figures for the per-language leaderboard post.
Two kinds of figure, from two sources:
tasks - how many benchmark tasks exist per language, and of what kind.
Needs only MTEB metadata, so it runs offline in seconds.
scores - per-language scores for the top models, from a leaderboard CSV.
Indic languages come first in every figure, then a contrast set of world
@santhoshtr
santhoshtr / wiki.sh
Created June 19, 2026 09:26
wiki — a fast, fzf-based Wikipedia reader
#!/usr/bin/env bash
#
# wiki — a fast, fzf-based Wikipedia reader.
#
# Usage:
# wiki # English (default)
# wiki de # German, fr, es, ... (any Wikipedia language code)
#
# Type to live-search article titles via Wikipedia's prefixsearch API,
# read the plain-text article in the preview pane, press Enter to open it
@santhoshtr
santhoshtr / wc-width-test.c
Created March 22, 2026 05:37
wc-width-test.c
#define _XOPEN_SOURCE
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
int main(void) {
setlocale(LC_ALL, "");
struct {
wchar_t ch;
@santhoshtr
santhoshtr / main.mp
Last active February 14, 2026 04:20
Untitled Metapost Sample #metapost-sandbox
beginfig(0);
width:=100;
rotation:=-45;
pen calligraphicpen ;
calligraphicpen := makepen ((0, 0)--(width,0 ) rotated rotation) ;
z0 = (x1+150, 0);
z1 = (0, y0+250);
@santhoshtr
santhoshtr / main.mp
Created February 13, 2026 10:05
Untitled Metapost Sample #metapost-sandbox
% 设置输出文件名
outputtemplate := "%j.svg";
beginfig(1);
% --- 1. 变量声明 ---
numeric u, hex_R, hex_W;
numeric stem_w, bar_h, f_top_y;
color main_color;
path boundary_path;
picture fh_pattern;
@santhoshtr
santhoshtr / main.mp
Created February 13, 2026 10:04
korean_flag #metapost-sandbox
beginfig(1);
u := 1mm;
radius := 50u; % 태극의 반지름 (R)
diameter := 2radius; % 태극의 지름 (D = 100u)
height := 200u;
width := 300u;
pair O; O := (width/2, height/2); % 국기 중심
% 1. 표준 비율 설정 (대한민국 국기법 규정)
@santhoshtr
santhoshtr / main.mp
Created February 13, 2026 10:04
Untitled Metapost Sample #metapost-sandbox
prologues := 3;
outputtemplate := "%j-%c.mps";
beginfig(1);
% =============== ПЕРВЫЙ ГРАФИК (слева) ===============
% Масштаб и размеры
u := 1.5cm;
% Сдвиг для размещения графиков рядом
@santhoshtr
santhoshtr / main.mp
Created February 13, 2026 10:04
Untitled Metapost Sample #metapost-sandbox
u := 1cm;
path curve;
curve := (0,-1.5u) .. controls (2u,-1.2u) and (4u,0) .. (5.5u,2.5u);
% РИСУНОК 1
beginfig(1);
drawarrow (-0.5u,0)--(6.5u,0);
label.bot("x", (6.5u,0));