Upload folder using huggingface_hub
Browse filesFiles changed (25)
- .gitattributes+8
- README.mdAdded+214
- multilingual/infer.pyAdded+154
- multilingual/model.binAdded+3
- multilingual/train.pyAdded+12
- multilingual/train.txtAdded+3
- multilingual/val.txtAdded+3
- quality/__pycache__/infer.cpython-312.pycAdded
- quality/infer.pyAdded+153
- quality/model.binAdded+3
- quality/train.pyAdded+11
- quality/train.txtAdded+3
- quality/val.txtAdded+3
- research_novelty/bins.jsonAdded+28
- research_novelty/infer.pyAdded+156
- research_novelty/model.binAdded+3
- research_novelty/train.pyAdded+12
- research_novelty/train.txtAdded+3
- research_novelty/val.txtAdded+3
- tags/infer.pyAdded+174
- tags/model.binAdded+3
- tags/tag_vocab.jsonAdded+855
- tags/train.pyAdded+12
- tags/train.txtAdded+3
- tags/val.txtAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363738394041424332 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textmultilingual/train.txt filter=lfs diff=lfs merge=lfs -textmultilingual/val.txt filter=lfs diff=lfs merge=lfs -textquality/train.txt filter=lfs diff=lfs merge=lfs -textquality/val.txt filter=lfs diff=lfs merge=lfs -textresearch_novelty/train.txt filter=lfs diff=lfs merge=lfs -textresearch_novelty/val.txt filter=lfs diff=lfs merge=lfs -texttags/train.txt filter=lfs diff=lfs merge=lfs -texttags/val.txt filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214# PR quality/multilingual/tags fastText classifiers
Four fastText classifiers that score or tag a GitHub PR from its diff + touched-filecontent, distilled from Jev (`typesafe/jev-1.13`) annotations on mined GitHub ArchivePRs. Each subfolder is self-contained: `model.bin` (weights), `train.txt`/`val.txt`(the exact fastText training data), `train.py` (the exact training call — rerun inplace to reproduce `model.bin` from `train.txt`), and `infer.py` (standalone scoringscript — fetches a live PR via the GitHub API and classifies it, no dependency on theoriginal mining pipeline).
## Usage
```bashpip install fasttext==0.9.3 "numpy<2" requests # numpy<2 is required -- see note belowexport GITHUB_PAT=... # any GitHub token (read-only is fine)python quality/infer.py https://github.com/owner/repo/pull/123python multilingual/infer.py https://github.com/owner/repo/pull/123python research_novelty/infer.py https://github.com/owner/repo/pull/123python tags/infer.py https://github.com/owner/repo/pull/123 # multi-labelpython tags/infer.py --threshold 0.3 https://github.com/owner/repo/pull/123```
To retrain a model from its own `train.txt` in place: `cd <subfolder> && python train.py`.
`quality`/`multilingual`/`research_novelty` each print a `soft` score (probability-weighted expected value, the better-correlating of the two — use this) and a `hard`score (argmax level), both on a 0-10 scale. `tags` instead prints every tag (of 424)whose predicted probability clears `--threshold` (default 0.5), sorted by confidence —see its own section below for why it's one multi-label model, not 424 separate ones.
**Note on fastText + NumPy 2.x:** the prebuilt `fasttext-wheel` can silently corruptbatch-`predict()` probabilities under NumPy 2.x, and even a from-source build's Pythonwrapper crashes outright on `np.array(..., copy=False)`. Pin `numpy<2`.
## `quality/` — Jev's strict 0-10 quality rubric
Rates the PR's diff on a strict, sensibility-gated 0-10 scale: 0-5 is gated on whetherthe codebase/diff is coherent and credible (a simple-but-clean change tops out at 5); 6+requires genuine engineering or conceptual complexity on top of that. See`annotate_pr_quality.py`'s `QUALITY_LEVELS` for the full rubric text.
- **Hyperparameters**: dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2,000,000- **Train**: 254,143 PRs (`train.txt`)- **Val**: 28,238 PRs, 1,766 at level≥6 (`val.txt`)
**This is the plain dim64/epoch10 baseline** — every variant tried (2-4x capacity, class-rebalanced train sets, a ~1.55x-larger combined corpus with a separately-minedhigher-credibility PR pool) came out flat or slightly worse on a held-out 10,000-PRtracking set (685 at quality≥6). More data/capacity does not fix this classifier;treat it as a known ceiling, not a bug to chase.
**Metrics** (10,000-PR tracking holdout, rule = `quality >= 6`):
| metric | value ||---|---|| rule accuracy | 93.73% || precision | 74.17% || **recall** | **12.99%** || exact-level accuracy | 78.01% || MAE | 0.531 || soft Pearson / Spearman | 0.7252 / 0.6339 |
**Read this before using it as a filter**: it misses ~87% of genuinely good PRs(quality≥6) to keep false positives to 0.33% of negatives, and its own predictions neverexceed ~6.8-7 on any PR we've tested — it is a high-precision, very-low-recall filter,not a general-purpose quality scorer. It also gave near-identical predictions (4.4-5.3)to real, high-quality ML/research PRs (e.g. lucidrains' `x-transformers`, `imagen-pytorch`)as to trivial personal-repo PRs — it is not sensitive to genuine technical depth. Loweringthe decision threshold to `>=5` makes this *worse*, not better (accuracy drops to 37%,since ~80% of real PRs are already `>=5` and the model's own predicted mass sits belowthat line).
## `multilingual/` — non-English comment/string content
Purely descriptive 0-10 scale: how much non-English natural-language text (comments,docstrings, string literals) appears in the diff and touched files, independent of theprogramming language itself. See `annotate_pr_quality.py`'s `MULTILINGUAL_LEVELS`.
- **Hyperparameters**: dim=128, epoch=25, lr=0.3, wordNgrams=2, minCount=3, bucket=2,000,000 (best of a capacity sweep vs dim64/epoch10 baseline and dim256/epoch25 — dim128 won on every axis, dim256 added nothing further for 2x the model size)- **Train**: 254,143 PRs (`train.txt`)- **Val**: 28,238 PRs (`val.txt`)
**Metrics** (100-PR live holdout, 79 true positives, rule = `multilingual <= 1`):
| metric | value ||---|---|| rule accuracy | 96.00% || precision | 96.30% || **recall** | **98.73%** || MAE | 0.586 || Pearson / Spearman | 0.906 / 0.721 |
This one is genuinely reliable as a pre-filter — high recall *and* precision. If you onlytrust one of these two classifiers for a filtering decision, trust this one.
## `research_novelty/` — research/IP content (⚠️ still recall≈0 at the `>=6` rule)
0-10 scale rating the extent to which the PR implements technical algorithms, ideas fromresearch papers, or original design/IP, as opposed to routine engineering — independentof how difficult or high-quality the engineering itself is. See `annotate_pr_quality.py`'s`RESEARCH_NOVELTY_LEVELS`.
- **Hyperparameters**: dim=64, epoch=10 (same baseline as `quality`/`multilingual`)- **Train**: 96,634 PRs, 297 at level≥6 (`train.txt`)- **Val**: 10,772 PRs, 35 at level≥6 (`val.txt`)- **Same train/val PR ids as `tags/`** (both come from the same annotation batch; see Provenance) — comparable across the two.
**Updated 2026-09-30**: retrained on a new 107,406-PR annotation batch (up from theoriginal 39,081-PR/98-positive pass), joined back to `quality`/`multilingual`'s existing`text` field so the same 254K+-PR pool's diff/file content is reused rather thanre-mined. Labels use the field's own fixed 0-10 scale (int truncation), same as`quality`/`multilingual` — not sample quantiles.
**Metrics** (own val.txt, 10,772 PRs):
| metric | value ||---|---|| exact-level accuracy | 82.45% || within-1-level accuracy | 94.06% || MAE | 0.2745 || hard Pearson / Spearman | 0.5679 / 0.5069 || soft Pearson / Spearman | 0.6662 / 0.5470 || rule (`>=6`) accuracy | 99.68% || rule (`>=6`) precision | undefined (0 predicted positive) || **rule (`>=6`) recall** | **0.00%** (0/35) |
**Read this before using it as a filter**: correlation improved modestly over the olddiagnostic pass (soft Pearson 0.60→0.67) and the accuracy/MAE numbers look good, but that'salmost entirely the near-100%-easy "correctly predict low novelty" majority class — at theactual decision boundary that matters (`>=6`), it now has enough val data to sayconfidently (35 true positives, not 2) that it **misses every single one**, the samerecall-collapse pattern as `quality`. Its own predictions rarely if ever clear ~6-7 (seethe Megatron-LM spot-check below). Treat it as a continuous novelty *signal* (the softscore correlates reasonably, 0.67) rather than a working `>=6` binary classifier.
**Spot-check**: `NVIDIA/Megatron-LM#7762` (an Engram/CUDA synchronization change) scoressoft=2.46, hard=1 — plausible as "some genuine ML-systems depth but not paper-derived,"though still likely underrating it given the classifier's known insensitivity to realtechnical depth (see `quality`'s note above; the same failure mode shows up here).
## `tags/` — multi-label topic tagging (424 tags)
Multi-label classification over the topic vocabulary in `/ansh/harbor-tags.txt` (424distinct tags after dedup — e.g. `python`, `machine-learning`, `web-security`,`gpu`, `formal methods`) — any number of tags can apply to one PR, independently.Each tag is an independent Jev "noul" (boolean-probability) claim ("this PR's diff ortouched files involve code/content related to topic X"), bundled into one Jev call perPR alongside `research_novelty` (see `annotate_tags_research.py`).
**One joint multi-label model, not 424 separate binary classifiers.** fastText's nativemulti-label mode (`loss="ova"`, one-vs-all) shares a single embedding/vocabulary acrossall 424 tags and trains in one pass — dramatically cheaper than 424x the trainingtime/storage for what is fundamentally the same text signal, at the cost of slightlyless per-tag threshold flexibility (mitigated by tuning `--threshold` in `infer.py`per use case; default 0.5).
- **Hyperparameters**: dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2,000,000, **loss=ova**- **Train**: 96,604 PRs (`train.txt`) / **Val**: 10,769 PRs (`val.txt`) — same PR ids as `research_novelty/`'s updated split (both from the same annotation batch)- 33 PRs with zero tags above threshold were dropped (fastText needs ≥1 label/line)
**Metrics** (10,769-PR val set, pooled across all 10,769×424 PR-tag pairs, threshold=0.5):
| metric | value ||---|---|| **precision** | **81.95%** || **recall** | **57.17%** || f1 | 67.35% || pooled Pearson r (vs. Jev's raw `tag_probs`) | **0.8055** || pooled Spearman ρ | **0.7145** |
Precision stays high across common tags (0.79-0.99) with recall degrading gracefully asper-tag support drops — normal multi-label behavior, not a red flag. This is thebest-behaved of the four classifiers relative to its task difficulty (a 424-waymulti-label problem vs. a single 0-10 scale).
**Known data-hygiene issue**: `harbor-tags.txt` has a couple of near-duplicate tag pairsthat survived as distinct labels (`data processing`/`data-processing`, `dataengineering`/`data_engineering` — the latter pair also collided post-slugification andone was suffixed `_dup` in `tag_vocab.json` to disambiguate). Worth deduping the sourcefile; not fixed here since it would invalidate the current label vocabulary/model.
**Spot-check**: `vercel/next.js#99499` (a tag-revalidation fix) → 30 tags incl.`typescript`, `react`, `nextjs`, `frontend`, `routing`, `concurrency`, `web-server`.`NVIDIA/Megatron-LM#7762` → 36 tags incl. `machine-learning`, `pytorch`, `cuda`, `gpu`,`distributed-systems`, `performance-optimization`, `deeply-technical-ip`. Both matchwhat a human skim of the PRs would tag.
## Provenance
- Distilled from `typesafe/jev-1.13` (via OpenRouter) on GitHub Archive-mined PRs.- Full annotation/training pipeline: `/ansh/prism-datagen/annotate_pr_quality.py` (rubric + Jev calls, incl. `HARBOR_TAGS`/`TAG_CLAIMS`), `/ansh/fasttext-stuff/run.py`/ `train_sweep.py` (quality/multilingual training — each subfolder's `train.py` is the relevant one of these, trimmed to a single model), `/ansh/fasttext-stuff/evaluate.py`/ `evaluate_sweep.py`/`compare_pre_post.py` (eval).- `quality`'s known ceiling was diagnosed, not guessed: a dim/epoch capacity sweep (64→128→256), a class-rebalancing ablation (10%/15% minority oversampling), and a ~1.55x larger combined training corpus (adding a separately GitHub-credibility-filtered PR pool skewed toward higher quality) were all tried and none moved recall past ~14%.- `research_novelty`/`tags` come from a separate, lighter-weight annotation pass: `/ansh/prism-datagen/annotate_tags_research.py` re-streams the same S3 source `quality`/`multilingual` were mined from, filtered to PR ids already in that 254K+-PR corpus, and asks Jev only for `research_novelty` + the 424 tag claims (bundled into one call per PR, not 424 separate calls) — reusing that corpus's existing `text` field rather than re-annotating everything from scratch. Dataset build: `/ansh/fasttext-stuff/build_research_novelty_v2_dataset.py` and `build_tags_dataset.py` (both replicate `quality`/`multilingual`'s exact train/val split — same seed, same 10%, same PR ids — for cross-classifier comparability). Training/eval: each subfolder's own `train.py`/`evaluate.py`.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154"""Standalone inference: fetch a live GitHub PR and score it with this multilingualclassifier (0-10: how much non-English comment/doc/string text appears in the diff andtouched files -- purely descriptive, not a quality judgment). Self-contained -- onlyneeds `requests` and `fasttext` installed (see /ansh/fasttext-stuff/requirements.txt:fasttext==0.9.3, numpy<2, scipy<1.14 if you also want the correlation-metric scripts;numpy<2 alone is required for fasttext's batch predict() to work at all).
Usage: export GITHUB_PAT=... # a GitHub personal access token (read-only is fine) python infer.py https://github.com/owner/repo/pull/123 [more PR urls...]
The text fed to the model is built EXACTLY the way training data was: the samerender_document() + fasttext_preprocess() pipeline as annotate_pr_quality.py, so ascore here is directly comparable to what's in train.txt/val.txt."""import base64import osimport reimport sys
import fasttextimport requests
HERE = os.path.dirname(os.path.abspath(__file__))MODEL_PATH = os.path.join(HERE, "model.bin")
MAX_FILES = 10MAX_FILE_CHARS = 4_000MAX_DIFF_CHARS = 12_000MAX_FASTTEXT_TOKENS = 4_096NON_CODE_EXTS = {"json", "xml"}TOKEN_PATTERN = re.compile(r"\w+(?:['’]\w+)*|[^\w\s]", re.UNICODE)
TOKEN = os.environ["GITHUB_PAT"]HEADERS = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github+json"}
def truncate(text, limit): if text is None: return None if len(text) <= limit: return text return text[:limit] + f"\n...[truncated, {len(text) - limit} more chars]"
def fasttext_preprocess(text): tokens = [] for match in TOKEN_PATTERN.finditer(text.casefold()): if len(tokens) == MAX_FASTTEXT_TOKENS: break token = match.group() if token.startswith("__label__"): token = "literal_" + token tokens.append(token) return " ".join(tokens)
def render_document(state): lines = [f"repo : {state['repo']['full_name']}"] if state["repo"]["description"]: lines.append(f"description : {state['repo']['description']}") lines.append(f"stars : {state['repo']['stars']}") if state["repo"]["license"]: lines.append(f"license : {state['repo']['license']}") if state["pull_request_title"]: lines.append(f"title : {state['pull_request_title']}") lines.append("touched files : " + ", ".join(state["all_touched_files"])) for f in state["files"]: lines.append(f"--- {f['path']} (pre-change) ---") lines.append(f["pre_change_content"] or "[new file]") lines.append("--- diff ---") lines.append(state["diff"] or "") return "\n".join(lines)
def get(url, headers=None, **kw): resp = requests.get(url, headers=headers or HEADERS, timeout=20, **kw) resp.raise_for_status() return resp
def parse_pr_url(url): m = re.search(r"github\.com/([^/]+)/([^/]+)/pull/(\d+)", url) return m.group(1), m.group(2), int(m.group(3))
def fetch_state(pr_url): owner, repo, number = parse_pr_url(pr_url) repo_full = f"{owner}/{repo}"
repo_info = get(f"https://api.github.com/repos/{repo_full}").json() pr_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}").json() files_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}/files", params={"per_page": 100}).json() diff = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}", headers={**HEADERS, "Accept": "application/vnd.github.v3.diff"}).text
base_sha = pr_info["base"]["sha"] all_touched_files = [f["filename"] for f in files_info]
picked = [] for f in files_info: path = f["filename"] ext = path.rsplit(".", 1)[-1].lower() if "." in path else "" if ext in NON_CODE_EXTS: continue content = None if f["status"] != "added": try: c = get(f"https://api.github.com/repos/{repo_full}/contents/{path}", params={"ref": base_sha}).json() if c.get("encoding") == "base64": content = base64.b64decode(c["content"]).decode("utf-8", errors="replace") except requests.HTTPError: content = None picked.append({"path": path, "pre_change_content": truncate(content, MAX_FILE_CHARS)}) if len(picked) == MAX_FILES: break
license_ = repo_info.get("license") or {} return { "repo": { "full_name": repo_full, "description": repo_info.get("description"), "stars": repo_info.get("stargazers_count"), "license": license_.get("spdx_id") or license_.get("name"), }, "pull_request_title": pr_info.get("title"), "all_touched_files": all_touched_files, "files": picked, "diff": truncate(diff, MAX_DIFF_CHARS), }
def predict(model, text): n_labels = len(model.get_labels()) labels, probs = model.predict(text, k=n_labels) soft = sum(p * int(l.rsplit("_", 1)[1]) for l, p in zip(labels, probs)) hard = int(labels[0].rsplit("_", 1)[1]) return soft, hard
if __name__ == "__main__": if len(sys.argv) < 2: raise SystemExit("usage: python infer.py <github PR url> [more PR urls...]")
model = fasttext.load_model(MODEL_PATH) for pr_url in sys.argv[1:]: state = fetch_state(pr_url) text = fasttext_preprocess(render_document(state)) soft, hard = predict(model, text) print(f"{pr_url}") print(f" repo: {state['repo']['full_name']} stars: {state['repo']['stars']}") print(f" predicted multilingual score: soft={soft:.2f} hard_level={hard}\n")123version https://git-lfs.github.com/spec/v1oid sha256:13e27ed9bfe7f186579f95c6e58345e1a7f9061fc207b60f8e1b95617d6bd3bfsize 2545727308123456789101112"""Exact training call used for this model. Run from inside this directory: python train.pyRetrains model.bin from train.txt in place (dim=128/epoch=25 -- the winner of a capacitysweep against dim=64/epoch=10 and dim=256/epoch=25; dim256 added nothing further, seeREADME.md)."""import fasttext
HPARAMS = dict(dim=128, epoch=25, lr=0.3, wordNgrams=2, minCount=3, bucket=2_000_000)
model = fasttext.train_supervised(input="train.txt", **HPARAMS)model.save_model("model.bin")print("saved model.bin")123version https://git-lfs.github.com/spec/v1oid sha256:3ec67e1e15a3844f1f914f55882fbc97024c51ed9a39a555d6901da13c069768size 2802807438123version https://git-lfs.github.com/spec/v1oid sha256:b26041cdb01d61d1d3fc91bbbbecc8b43e3ecfb987055da93b8c4cda1f660061size 309577373123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153"""Standalone inference: fetch a live GitHub PR and score it with this qualityclassifier. Self-contained -- only needs `requests` and `fasttext` installed(see /ansh/fasttext-stuff/requirements.txt: fasttext==0.9.3, numpy<2, scipy<1.14if you also want the correlation-metric scripts; numpy<2 alone is required forfasttext's batch predict() to work at all).
Usage: export GITHUB_PAT=... # a GitHub personal access token (read-only is fine) python infer.py https://github.com/owner/repo/pull/123 [more PR urls...]
The text fed to the model is built EXACTLY the way training data was: the samerender_document() + fasttext_preprocess() pipeline as annotate_pr_quality.py, so ascore here is directly comparable to what's in train.txt/val.txt."""import base64import osimport reimport sys
import fasttextimport requests
HERE = os.path.dirname(os.path.abspath(__file__))MODEL_PATH = os.path.join(HERE, "model.bin")
MAX_FILES = 10MAX_FILE_CHARS = 4_000MAX_DIFF_CHARS = 12_000MAX_FASTTEXT_TOKENS = 4_096NON_CODE_EXTS = {"json", "xml"}TOKEN_PATTERN = re.compile(r"\w+(?:['’]\w+)*|[^\w\s]", re.UNICODE)
TOKEN = os.environ["GITHUB_PAT"]HEADERS = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github+json"}
def truncate(text, limit): if text is None: return None if len(text) <= limit: return text return text[:limit] + f"\n...[truncated, {len(text) - limit} more chars]"
def fasttext_preprocess(text): tokens = [] for match in TOKEN_PATTERN.finditer(text.casefold()): if len(tokens) == MAX_FASTTEXT_TOKENS: break token = match.group() if token.startswith("__label__"): token = "literal_" + token tokens.append(token) return " ".join(tokens)
def render_document(state): lines = [f"repo : {state['repo']['full_name']}"] if state["repo"]["description"]: lines.append(f"description : {state['repo']['description']}") lines.append(f"stars : {state['repo']['stars']}") if state["repo"]["license"]: lines.append(f"license : {state['repo']['license']}") if state["pull_request_title"]: lines.append(f"title : {state['pull_request_title']}") lines.append("touched files : " + ", ".join(state["all_touched_files"])) for f in state["files"]: lines.append(f"--- {f['path']} (pre-change) ---") lines.append(f["pre_change_content"] or "[new file]") lines.append("--- diff ---") lines.append(state["diff"] or "") return "\n".join(lines)
def get(url, headers=None, **kw): resp = requests.get(url, headers=headers or HEADERS, timeout=20, **kw) resp.raise_for_status() return resp
def parse_pr_url(url): m = re.search(r"github\.com/([^/]+)/([^/]+)/pull/(\d+)", url) return m.group(1), m.group(2), int(m.group(3))
def fetch_state(pr_url): owner, repo, number = parse_pr_url(pr_url) repo_full = f"{owner}/{repo}"
repo_info = get(f"https://api.github.com/repos/{repo_full}").json() pr_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}").json() files_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}/files", params={"per_page": 100}).json() diff = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}", headers={**HEADERS, "Accept": "application/vnd.github.v3.diff"}).text
base_sha = pr_info["base"]["sha"] all_touched_files = [f["filename"] for f in files_info]
picked = [] for f in files_info: path = f["filename"] ext = path.rsplit(".", 1)[-1].lower() if "." in path else "" if ext in NON_CODE_EXTS: continue content = None if f["status"] != "added": try: c = get(f"https://api.github.com/repos/{repo_full}/contents/{path}", params={"ref": base_sha}).json() if c.get("encoding") == "base64": content = base64.b64decode(c["content"]).decode("utf-8", errors="replace") except requests.HTTPError: content = None picked.append({"path": path, "pre_change_content": truncate(content, MAX_FILE_CHARS)}) if len(picked) == MAX_FILES: break
license_ = repo_info.get("license") or {} return { "repo": { "full_name": repo_full, "description": repo_info.get("description"), "stars": repo_info.get("stargazers_count"), "license": license_.get("spdx_id") or license_.get("name"), }, "pull_request_title": pr_info.get("title"), "all_touched_files": all_touched_files, "files": picked, "diff": truncate(diff, MAX_DIFF_CHARS), }
def predict(model, text): n_labels = len(model.get_labels()) labels, probs = model.predict(text, k=n_labels) soft = sum(p * int(l.rsplit("_", 1)[1]) for l, p in zip(labels, probs)) hard = int(labels[0].rsplit("_", 1)[1]) return soft, hard
if __name__ == "__main__": if len(sys.argv) < 2: raise SystemExit("usage: python infer.py <github PR url> [more PR urls...]")
model = fasttext.load_model(MODEL_PATH) for pr_url in sys.argv[1:]: state = fetch_state(pr_url) text = fasttext_preprocess(render_document(state)) soft, hard = predict(model, text) print(f"{pr_url}") print(f" repo: {state['repo']['full_name']} stars: {state['repo']['stars']}") print(f" predicted score: soft={soft:.2f} hard_level={hard}\n")123version https://git-lfs.github.com/spec/v1oid sha256:2037f469a40e1baada22d185d549a22f36ac8fce8f6a752e51e357b43e1279d0size 13065556701234567891011"""Exact training call used for this model. Run from inside this directory: python train.pyRetrains model.bin from train.txt in place (dim=64/epoch=10 baseline -- see README.mdfor why higher capacity/rebalancing/more data were all tried and didn't help recall)."""import fasttext
HPARAMS = dict(dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2_000_000)
model = fasttext.train_supervised(input="train.txt", **HPARAMS)model.save_model("model.bin")print("saved model.bin")123version https://git-lfs.github.com/spec/v1oid sha256:190483bf69835756e28e282a2e3de1152046199c00ee6821efb0eb649781b90asize 2802807438123version https://git-lfs.github.com/spec/v1oid sha256:f244d446eff36e234c5c8a3ccfc3d2d3f22defdd52f86f7a84b0bc2861faf61csize 30957737312345678910111213141516171819202122232425262728{ "counts": [ 87150, 11209, 4607, 2167, 1298, 645, 271, 57, 2, 0, 0 ], "bin_means": [ 0.23606701090074586, 1.4044954946917656, 2.425053179943564, 3.457143516382095, 4.4452234206471495, 5.416713178294574, 6.39959409594096, 7.317368421052632, 8.32, null, null ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156"""Standalone inference: fetch a live GitHub PR and score it with this research/IP-novelty classifier (0-10: the extent to which the PR implements technical algorithms,paper-derived ideas, or original design, vs routine engineering -- see README.md forthe SEVERE data-scarcity caveat, this model should not be trusted much yet).Self-contained -- only needs `requests` and `fasttext` installed (see/ansh/fasttext-stuff/requirements.txt: fasttext==0.9.3, numpy<2, scipy<1.14 if you alsowant the correlation-metric scripts; numpy<2 alone is required for fasttext's batchpredict() to work at all).
Usage: export GITHUB_PAT=... # a GitHub personal access token (read-only is fine) python infer.py https://github.com/owner/repo/pull/123 [more PR urls...]
The text fed to the model is built EXACTLY the way training data was: the samerender_document() + fasttext_preprocess() pipeline as annotate_pr_quality.py, so ascore here is directly comparable to what's in train.txt/val.txt."""import base64import osimport reimport sys
import fasttextimport requests
HERE = os.path.dirname(os.path.abspath(__file__))MODEL_PATH = os.path.join(HERE, "model.bin")
MAX_FILES = 10MAX_FILE_CHARS = 4_000MAX_DIFF_CHARS = 12_000MAX_FASTTEXT_TOKENS = 4_096NON_CODE_EXTS = {"json", "xml"}TOKEN_PATTERN = re.compile(r"\w+(?:['’]\w+)*|[^\w\s]", re.UNICODE)
TOKEN = os.environ["GITHUB_PAT"]HEADERS = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github+json"}
def truncate(text, limit): if text is None: return None if len(text) <= limit: return text return text[:limit] + f"\n...[truncated, {len(text) - limit} more chars]"
def fasttext_preprocess(text): tokens = [] for match in TOKEN_PATTERN.finditer(text.casefold()): if len(tokens) == MAX_FASTTEXT_TOKENS: break token = match.group() if token.startswith("__label__"): token = "literal_" + token tokens.append(token) return " ".join(tokens)
def render_document(state): lines = [f"repo : {state['repo']['full_name']}"] if state["repo"]["description"]: lines.append(f"description : {state['repo']['description']}") lines.append(f"stars : {state['repo']['stars']}") if state["repo"]["license"]: lines.append(f"license : {state['repo']['license']}") if state["pull_request_title"]: lines.append(f"title : {state['pull_request_title']}") lines.append("touched files : " + ", ".join(state["all_touched_files"])) for f in state["files"]: lines.append(f"--- {f['path']} (pre-change) ---") lines.append(f["pre_change_content"] or "[new file]") lines.append("--- diff ---") lines.append(state["diff"] or "") return "\n".join(lines)
def get(url, headers=None, **kw): resp = requests.get(url, headers=headers or HEADERS, timeout=20, **kw) resp.raise_for_status() return resp
def parse_pr_url(url): m = re.search(r"github\.com/([^/]+)/([^/]+)/pull/(\d+)", url) return m.group(1), m.group(2), int(m.group(3))
def fetch_state(pr_url): owner, repo, number = parse_pr_url(pr_url) repo_full = f"{owner}/{repo}"
repo_info = get(f"https://api.github.com/repos/{repo_full}").json() pr_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}").json() files_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}/files", params={"per_page": 100}).json() diff = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}", headers={**HEADERS, "Accept": "application/vnd.github.v3.diff"}).text
base_sha = pr_info["base"]["sha"] all_touched_files = [f["filename"] for f in files_info]
picked = [] for f in files_info: path = f["filename"] ext = path.rsplit(".", 1)[-1].lower() if "." in path else "" if ext in NON_CODE_EXTS: continue content = None if f["status"] != "added": try: c = get(f"https://api.github.com/repos/{repo_full}/contents/{path}", params={"ref": base_sha}).json() if c.get("encoding") == "base64": content = base64.b64decode(c["content"]).decode("utf-8", errors="replace") except requests.HTTPError: content = None picked.append({"path": path, "pre_change_content": truncate(content, MAX_FILE_CHARS)}) if len(picked) == MAX_FILES: break
license_ = repo_info.get("license") or {} return { "repo": { "full_name": repo_full, "description": repo_info.get("description"), "stars": repo_info.get("stargazers_count"), "license": license_.get("spdx_id") or license_.get("name"), }, "pull_request_title": pr_info.get("title"), "all_touched_files": all_touched_files, "files": picked, "diff": truncate(diff, MAX_DIFF_CHARS), }
def predict(model, text): n_labels = len(model.get_labels()) labels, probs = model.predict(text, k=n_labels) soft = sum(p * int(l.rsplit("_", 1)[1]) for l, p in zip(labels, probs)) hard = int(labels[0].rsplit("_", 1)[1]) return soft, hard
if __name__ == "__main__": if len(sys.argv) < 2: raise SystemExit("usage: python infer.py <github PR url> [more PR urls...]")
model = fasttext.load_model(MODEL_PATH) for pr_url in sys.argv[1:]: state = fetch_state(pr_url) text = fasttext_preprocess(render_document(state)) soft, hard = predict(model, text) print(f"{pr_url}") print(f" repo: {state['repo']['full_name']} stars: {state['repo']['stars']}") print(f" predicted research_novelty score: soft={soft:.2f} hard_level={hard}\n")123version https://git-lfs.github.com/spec/v1oid sha256:ee241bd0d406b50af9dd3a2b51570e41a17a173065fd5fff3d5b04ddb9d238f5size 881045797123456789101112"""Exact training call used for this model. Run from inside this directory: python train.pySame dim64/epoch10 baseline hyperparams as quality/. Trained on the expanded107,406-PR research_novelty annotation batch (330 at level>=6, up from the original39,081-PR/98-positive pass) -- see README.md for current stats and caveats."""import fasttext
HPARAMS = dict(dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2_000_000)
model = fasttext.train_supervised(input="train.txt", **HPARAMS)model.save_model("model.bin")print("saved model.bin")123version https://git-lfs.github.com/spec/v1oid sha256:ec4190a66eb1dcf212ed1f015f0cac0464bca7667daa74655cb52a9fc0e58d24size 1065555987123version https://git-lfs.github.com/spec/v1oid sha256:a821e6e2daba9bc2575e2ccc984e159a08f858675864ae5bf64e73fdb077cb9fsize 119036497123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174"""Standalone inference: fetch a live GitHub PR and tag it with this multi-labelclassifier (424 topics from harbor-tags.txt -- any number can apply to one PR).Self-contained -- only needs `requests` and `fasttext` installed (see/ansh/fasttext-stuff/requirements.txt: fasttext==0.9.3, numpy<2, scipy<1.14 if you alsowant the correlation-metric scripts; numpy<2 alone is required for fasttext's batchpredict() to work at all).
Usage: export GITHUB_PAT=... # a GitHub personal access token (read-only is fine) python infer.py https://github.com/owner/repo/pull/123 [more PR urls...] python infer.py --threshold 0.3 https://github.com/owner/repo/pull/123
The text fed to the model is built EXACTLY the way training data was: the samerender_document() + fasttext_preprocess() pipeline as annotate_pr_quality.py, so aprediction here is directly comparable to what's in train.txt/val.txt."""import base64import jsonimport osimport reimport sys
import fasttextimport requests
HERE = os.path.dirname(os.path.abspath(__file__))MODEL_PATH = os.path.join(HERE, "model.bin")VOCAB_PATH = os.path.join(HERE, "tag_vocab.json")
MAX_FILES = 10MAX_FILE_CHARS = 4_000MAX_DIFF_CHARS = 12_000MAX_FASTTEXT_TOKENS = 4_096NON_CODE_EXTS = {"json", "xml"}TOKEN_PATTERN = re.compile(r"\w+(?:['’]\w+)*|[^\w\s]", re.UNICODE)DEFAULT_THRESHOLD = 0.5
TOKEN = os.environ["GITHUB_PAT"]HEADERS = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github+json"}
def truncate(text, limit): if text is None: return None if len(text) <= limit: return text return text[:limit] + f"\n...[truncated, {len(text) - limit} more chars]"
def fasttext_preprocess(text): tokens = [] for match in TOKEN_PATTERN.finditer(text.casefold()): if len(tokens) == MAX_FASTTEXT_TOKENS: break token = match.group() if token.startswith("__label__"): token = "literal_" + token tokens.append(token) return " ".join(tokens)
def render_document(state): lines = [f"repo : {state['repo']['full_name']}"] if state["repo"]["description"]: lines.append(f"description : {state['repo']['description']}") lines.append(f"stars : {state['repo']['stars']}") if state["repo"]["license"]: lines.append(f"license : {state['repo']['license']}") if state["pull_request_title"]: lines.append(f"title : {state['pull_request_title']}") lines.append("touched files : " + ", ".join(state["all_touched_files"])) for f in state["files"]: lines.append(f"--- {f['path']} (pre-change) ---") lines.append(f["pre_change_content"] or "[new file]") lines.append("--- diff ---") lines.append(state["diff"] or "") return "\n".join(lines)
def get(url, headers=None, **kw): resp = requests.get(url, headers=headers or HEADERS, timeout=20, **kw) resp.raise_for_status() return resp
def parse_pr_url(url): m = re.search(r"github\.com/([^/]+)/([^/]+)/pull/(\d+)", url) return m.group(1), m.group(2), int(m.group(3))
def fetch_state(pr_url): owner, repo, number = parse_pr_url(pr_url) repo_full = f"{owner}/{repo}"
repo_info = get(f"https://api.github.com/repos/{repo_full}").json() pr_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}").json() files_info = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}/files", params={"per_page": 100}).json() diff = get(f"https://api.github.com/repos/{repo_full}/pulls/{number}", headers={**HEADERS, "Accept": "application/vnd.github.v3.diff"}).text
base_sha = pr_info["base"]["sha"] all_touched_files = [f["filename"] for f in files_info]
picked = [] for f in files_info: path = f["filename"] ext = path.rsplit(".", 1)[-1].lower() if "." in path else "" if ext in NON_CODE_EXTS: continue content = None if f["status"] != "added": try: c = get(f"https://api.github.com/repos/{repo_full}/contents/{path}", params={"ref": base_sha}).json() if c.get("encoding") == "base64": content = base64.b64decode(c["content"]).decode("utf-8", errors="replace") except requests.HTTPError: content = None picked.append({"path": path, "pre_change_content": truncate(content, MAX_FILE_CHARS)}) if len(picked) == MAX_FILES: break
license_ = repo_info.get("license") or {} return { "repo": { "full_name": repo_full, "description": repo_info.get("description"), "stars": repo_info.get("stargazers_count"), "license": license_.get("spdx_id") or license_.get("name"), }, "pull_request_title": pr_info.get("title"), "all_touched_files": all_touched_files, "files": picked, "diff": truncate(diff, MAX_DIFF_CHARS), }
def predict(model, tag_of_slug, text, threshold): n_labels = len(model.get_labels()) labels, probs = model.predict(text, k=n_labels) tagged = [] for label, prob in zip(labels, probs): slug = label[len("__label__"):] tag = tag_of_slug.get(slug, slug) if prob >= threshold: tagged.append((tag, float(prob))) tagged.sort(key=lambda x: -x[1]) return tagged
if __name__ == "__main__": args = sys.argv[1:] threshold = DEFAULT_THRESHOLD if args and args[0] == "--threshold": threshold = float(args[1]) args = args[2:] if not args: raise SystemExit("usage: python infer.py [--threshold 0.5] <github PR url> [more PR urls...]")
vocab = json.loads(open(VOCAB_PATH).read()) tag_of_slug = {v: k for k, v in vocab["slug_of"].items()}
model = fasttext.load_model(MODEL_PATH) for pr_url in args: state = fetch_state(pr_url) text = fasttext_preprocess(render_document(state)) tagged = predict(model, tag_of_slug, text, threshold) print(f"{pr_url}") print(f" repo: {state['repo']['full_name']} stars: {state['repo']['stars']}") print(f" {len(tagged)} tags (threshold={threshold}):") for tag, prob in tagged: print(f" {tag}: {prob:.3f}") print()123version https://git-lfs.github.com/spec/v1oid sha256:9b67d07e2442cc73f3303fe182738500821fe30afe41019a1b430176f69e98b9size 881160000123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855{ "tags": [ "3d-modeling", "AMT", "Bayesian-inference", "C", "ERP", "GSEA", "MES", "MusicXML", "R", "SATB", "TMT", "WMS", "adaptive-rejection-sampling", "administrative-data", "advertising", "after-sales", "aggregation", "algorithms", "analysis", "anonymization", "api", "applied-microeconomics", "applied-statistics", "asset-lineage", "async", "audio-transcription", "audit-provenance", "autokey-cipher", "aviation", "bash", "batching", "bayesian-network", "bayesian-statistics", "bcbs-279", "benchmark-construction", "bessel-functions", "binlog", "bioinformatics", "biology", "black-box-parity", "bootkit", "browser", "build-tools", "bun", "c", "c-programming", "cad", "caffe", "calendar", "cdc", "checkpoint-conversion", "cheminformatics", "chemistry", "chorale", "cli", "climate-science", "cloning", "cnn", "code-vulnerability", "coding", "cold-start", "combinatorial-optimization", "combinatorics", "common-weakness-enumeration", "compaction", "compilation", "compiled-extensions", "compilers", "compliance", "compression", "computer-use", "computer-vision", "concurrency", "config-generation", "config-management", "conflict-resolution", "connected_components", "constraint", "constraint-satisfaction", "contact-dynamics", "coq", "corewars", "counterparty-credit-risk", "cpp", "cpu", "crm", "cross-referencing", "cryptanalysis", "cryptography", "crystallography", "csv", "cuda", "custom-protocol", "cybersecurity", "cybersecurity-vulnerability-resolution", "dangerous-goods", "data", "data engineering", "data processing", "data-analysis", "data-integration", "data-linkage", "data-pipeline", "data-processing", "data-science", "data_engineering", "database", "databases", "datasets", "debian", "debugging", "decrypt", "deduplication", "deeply-technical-ip", "deepseek-r1", "dependency", "devops", "differential-expression", "digital-design", "dispatch", "distributed-systems", "distributed-training", "distributed_systems", "document-processing", "document-verification", "domain-reasoning", "drawing", "drift-detection", "driver-hours", "editable-layout", "email-server", "embedded-systems", "encryption", "ensembl-vep", "entity-resolution", "erp", "etl", "evaluation", "event-time", "excel", "exploration-exploitation", "fastapi", "fdtd", "feature-interpretation", "file-operations", "financial", "firmware", "fitting", "flight-planning", "forensics", "formal methods", "formal-mathematics", "formal-verification", "forms", "fp8", "fraud-detection", "freecad", "frontend", "fuel-planning", "gaming", "gaussian-process", "genomics", "geometry", "german-compliance", "git", "glycomics", "gpu", "gpu-parallelisms", "grader", "graph-algorithms", "graphic-design", "graphics", "h100", "hardware", "hardware-kernels", "hardware-modeling", "harmony", "heat-pumps", "hgvs", "histopathology", "historical-linguistics", "household-consumption", "hpc", "html-sanitization", "huggingface", "hydrogen-bonding", "ics-parsing", "image-processing", "images", "imo", "impeller", "incident-response", "inference", "information-retrieval", "infrastructure-configuration", "interpenetration", "intrastat", "inverse-design", "inverse-problem", "jax", "kafka", "kernel-optimization", "knowledge-graph", "knowledge-graphs", "kuramoto-sivashinsky", "large-scale-text-manipulation", "latency", "latex", "layout-analysis", "layout-reconstruction", "layout-shift", "lean4", "legacy-gui", "legacy-modernization", "legacy-software", "linux", "liquid_scintillation_counting", "list-decoding", "litdata", "live-surgery", "live-system", "llm", "llm-eval", "log-analysis", "logistics", "lsh", "lsm", "machine-learning", "mailing-list", "manufacturing", "mass-spectrometry", "mathematics", "mcmc", "mechanical-engineering", "medical-billing", "meep", "megatron", "memory-management", "meter-data", "migration", "minhash", "mixture-of-experts", "ml-monitoring", "ml-platform", "mlops", "model-risk", "model-training", "mteb", "mujoco", "multi-container", "multi-modal", "multi-service", "music", "mvcc", "mysql", "network", "network-analysis", "networking", "next.js", "nextjs", "no-verified-solution", "numerical-analysis", "numerical-approximation", "numerical-optimization", "numpy", "ocr", "offline-evaluation", "operating-systems", "optimization", "owl", "pandas", "panel-construction", "parametric", "parquet", "pathfinding", "pde", "penetration-testing", "performance", "performance-engineering", "performance-optimization", "phonology", "photonics", "physical-chemistry", "physics", "pipeline-parallelism", "pixel-matching", "planning", "playwright", "pmars", "postgresql", "pretraining", "privacy", "process-modeling", "production planning", "proofs", "protein-structure", "proteins", "proteomics", "ptrace", "pydrake", "pystan", "python", "python-extension", "python-migration", "pytorch", "qemu", "query-optimization", "qwen3-coder", "radiochemistry", "ray-tracing", "rdf", "react", "reasoning", "reasoning-model", "recovery", "reed-solomon", "regex", "reimplementation", "release-security", "report-generation", "research", "retrieval", "retro-computing", "retro-console", "reverse-engineering", "rocksdb", "routing", "rstan", "rtl", "rule-induction", "sa-ccr", "satb", "scala", "scheduling", "schema-mapping", "scientific-computing", "scipy", "security", "session-windows", "sglang", "simulation", "software-engineering", "software-installation", "source-maps", "spark", "sparql", "sparql-query", "spatial-reasoning", "spcas9", "spectral-methods", "spectroscopy", "speculative-decoding", "spring_clip", "sql", "sql-query", "sqlite", "stan", "state", "stateful-cli", "statistical-filing", "statistics", "stats", "storage-engine", "stream-processing", "streaming", "string-parsing", "string-rewriting", "structural-elucidation", "supramolecular-chemistry", "symbolic-math", "sympy", "sys-admin", "system", "system-on-chip", "tandem-ms", "tariffs", "template-matching", "temporal-reasoning", "tensor-parallelism", "tensorflow", "terminal", "text-editing", "theorem-proving", "time-series", "tokenization", "tool-calling", "topology", "topology-optimization", "trajectory-optimization", "transformer", "troubleshooting", "typescript", "typography", "uefi", "userform", "utility-billing", "validation", "vba", "vector-graphics", "verilog", "version-control", "video-processing", "vigenere", "vim", "vim-macros", "virtual-machine", "virtualization", "vision", "vllm", "vnc", "voice-leading", "wal", "warranty", "watermarks", "wdm", "web", "web-security", "web-server", "weight-balance", "windows-3.11", "workflow", "x86_64", "xss", "zero-downtime" ], "slug_of": { "3d-modeling": "3d-modeling", "AMT": "AMT", "Bayesian-inference": "Bayesian-inference", "C": "C", "ERP": "ERP", "GSEA": "GSEA", "MES": "MES", "MusicXML": "MusicXML", "R": "R", "SATB": "SATB", "TMT": "TMT", "WMS": "WMS", "adaptive-rejection-sampling": "adaptive-rejection-sampling", "administrative-data": "administrative-data", "advertising": "advertising", "after-sales": "after-sales", "aggregation": "aggregation", "algorithms": "algorithms", "analysis": "analysis", "anonymization": "anonymization", "api": "api", "applied-microeconomics": "applied-microeconomics", "applied-statistics": "applied-statistics", "asset-lineage": "asset-lineage", "async": "async", "audio-transcription": "audio-transcription", "audit-provenance": "audit-provenance", "autokey-cipher": "autokey-cipher", "aviation": "aviation", "bash": "bash", "batching": "batching", "bayesian-network": "bayesian-network", "bayesian-statistics": "bayesian-statistics", "bcbs-279": "bcbs-279", "benchmark-construction": "benchmark-construction", "bessel-functions": "bessel-functions", "binlog": "binlog", "bioinformatics": "bioinformatics", "biology": "biology", "black-box-parity": "black-box-parity", "bootkit": "bootkit", "browser": "browser", "build-tools": "build-tools", "bun": "bun", "c": "c", "c-programming": "c-programming", "cad": "cad", "caffe": "caffe", "calendar": "calendar", "cdc": "cdc", "checkpoint-conversion": "checkpoint-conversion", "cheminformatics": "cheminformatics", "chemistry": "chemistry", "chorale": "chorale", "cli": "cli", "climate-science": "climate-science", "cloning": "cloning", "cnn": "cnn", "code-vulnerability": "code-vulnerability", "coding": "coding", "cold-start": "cold-start", "combinatorial-optimization": "combinatorial-optimization", "combinatorics": "combinatorics", "common-weakness-enumeration": "common-weakness-enumeration", "compaction": "compaction", "compilation": "compilation", "compiled-extensions": "compiled-extensions", "compilers": "compilers", "compliance": "compliance", "compression": "compression", "computer-use": "computer-use", "computer-vision": "computer-vision", "concurrency": "concurrency", "config-generation": "config-generation", "config-management": "config-management", "conflict-resolution": "conflict-resolution", "connected_components": "connected_components", "constraint": "constraint", "constraint-satisfaction": "constraint-satisfaction", "contact-dynamics": "contact-dynamics", "coq": "coq", "corewars": "corewars", "counterparty-credit-risk": "counterparty-credit-risk", "cpp": "cpp", "cpu": "cpu", "crm": "crm", "cross-referencing": "cross-referencing", "cryptanalysis": "cryptanalysis", "cryptography": "cryptography", "crystallography": "crystallography", "csv": "csv", "cuda": "cuda", "custom-protocol": "custom-protocol", "cybersecurity": "cybersecurity", "cybersecurity-vulnerability-resolution": "cybersecurity-vulnerability-resolution", "dangerous-goods": "dangerous-goods", "data": "data", "data engineering": "data_engineering", "data processing": "data_processing", "data-analysis": "data-analysis", "data-integration": "data-integration", "data-linkage": "data-linkage", "data-pipeline": "data-pipeline", "data-processing": "data-processing", "data-science": "data-science", "data_engineering": "data_engineering_dup", "database": "database", "databases": "databases", "datasets": "datasets", "debian": "debian", "debugging": "debugging", "decrypt": "decrypt", "deduplication": "deduplication", "deeply-technical-ip": "deeply-technical-ip", "deepseek-r1": "deepseek-r1", "dependency": "dependency", "devops": "devops", "differential-expression": "differential-expression", "digital-design": "digital-design", "dispatch": "dispatch", "distributed-systems": "distributed-systems", "distributed-training": "distributed-training", "distributed_systems": "distributed_systems", "document-processing": "document-processing", "document-verification": "document-verification", "domain-reasoning": "domain-reasoning", "drawing": "drawing", "drift-detection": "drift-detection", "driver-hours": "driver-hours", "editable-layout": "editable-layout", "email-server": "email-server", "embedded-systems": "embedded-systems", "encryption": "encryption", "ensembl-vep": "ensembl-vep", "entity-resolution": "entity-resolution", "erp": "erp", "etl": "etl", "evaluation": "evaluation", "event-time": "event-time", "excel": "excel", "exploration-exploitation": "exploration-exploitation", "fastapi": "fastapi", "fdtd": "fdtd", "feature-interpretation": "feature-interpretation", "file-operations": "file-operations", "financial": "financial", "firmware": "firmware", "fitting": "fitting", "flight-planning": "flight-planning", "forensics": "forensics", "formal methods": "formal_methods", "formal-mathematics": "formal-mathematics", "formal-verification": "formal-verification", "forms": "forms", "fp8": "fp8", "fraud-detection": "fraud-detection", "freecad": "freecad", "frontend": "frontend", "fuel-planning": "fuel-planning", "gaming": "gaming", "gaussian-process": "gaussian-process", "genomics": "genomics", "geometry": "geometry", "german-compliance": "german-compliance", "git": "git", "glycomics": "glycomics", "gpu": "gpu", "gpu-parallelisms": "gpu-parallelisms", "grader": "grader", "graph-algorithms": "graph-algorithms", "graphic-design": "graphic-design", "graphics": "graphics", "h100": "h100", "hardware": "hardware", "hardware-kernels": "hardware-kernels", "hardware-modeling": "hardware-modeling", "harmony": "harmony", "heat-pumps": "heat-pumps", "hgvs": "hgvs", "histopathology": "histopathology", "historical-linguistics": "historical-linguistics", "household-consumption": "household-consumption", "hpc": "hpc", "html-sanitization": "html-sanitization", "huggingface": "huggingface", "hydrogen-bonding": "hydrogen-bonding", "ics-parsing": "ics-parsing", "image-processing": "image-processing", "images": "images", "imo": "imo", "impeller": "impeller", "incident-response": "incident-response", "inference": "inference", "information-retrieval": "information-retrieval", "infrastructure-configuration": "infrastructure-configuration", "interpenetration": "interpenetration", "intrastat": "intrastat", "inverse-design": "inverse-design", "inverse-problem": "inverse-problem", "jax": "jax", "kafka": "kafka", "kernel-optimization": "kernel-optimization", "knowledge-graph": "knowledge-graph", "knowledge-graphs": "knowledge-graphs", "kuramoto-sivashinsky": "kuramoto-sivashinsky", "large-scale-text-manipulation": "large-scale-text-manipulation", "latency": "latency", "latex": "latex", "layout-analysis": "layout-analysis", "layout-reconstruction": "layout-reconstruction", "layout-shift": "layout-shift", "lean4": "lean4", "legacy-gui": "legacy-gui", "legacy-modernization": "legacy-modernization", "legacy-software": "legacy-software", "linux": "linux", "liquid_scintillation_counting": "liquid_scintillation_counting", "list-decoding": "list-decoding", "litdata": "litdata", "live-surgery": "live-surgery", "live-system": "live-system", "llm": "llm", "llm-eval": "llm-eval", "log-analysis": "log-analysis", "logistics": "logistics", "lsh": "lsh", "lsm": "lsm", "machine-learning": "machine-learning", "mailing-list": "mailing-list", "manufacturing": "manufacturing", "mass-spectrometry": "mass-spectrometry", "mathematics": "mathematics", "mcmc": "mcmc", "mechanical-engineering": "mechanical-engineering", "medical-billing": "medical-billing", "meep": "meep", "megatron": "megatron", "memory-management": "memory-management", "meter-data": "meter-data", "migration": "migration", "minhash": "minhash", "mixture-of-experts": "mixture-of-experts", "ml-monitoring": "ml-monitoring", "ml-platform": "ml-platform", "mlops": "mlops", "model-risk": "model-risk", "model-training": "model-training", "mteb": "mteb", "mujoco": "mujoco", "multi-container": "multi-container", "multi-modal": "multi-modal", "multi-service": "multi-service", "music": "music", "mvcc": "mvcc", "mysql": "mysql", "network": "network", "network-analysis": "network-analysis", "networking": "networking", "next.js": "next.js", "nextjs": "nextjs", "no-verified-solution": "no-verified-solution", "numerical-analysis": "numerical-analysis", "numerical-approximation": "numerical-approximation", "numerical-optimization": "numerical-optimization", "numpy": "numpy", "ocr": "ocr", "offline-evaluation": "offline-evaluation", "operating-systems": "operating-systems", "optimization": "optimization", "owl": "owl", "pandas": "pandas", "panel-construction": "panel-construction", "parametric": "parametric", "parquet": "parquet", "pathfinding": "pathfinding", "pde": "pde", "penetration-testing": "penetration-testing", "performance": "performance", "performance-engineering": "performance-engineering", "performance-optimization": "performance-optimization", "phonology": "phonology", "photonics": "photonics", "physical-chemistry": "physical-chemistry", "physics": "physics", "pipeline-parallelism": "pipeline-parallelism", "pixel-matching": "pixel-matching", "planning": "planning", "playwright": "playwright", "pmars": "pmars", "postgresql": "postgresql", "pretraining": "pretraining", "privacy": "privacy", "process-modeling": "process-modeling", "production planning": "production_planning", "proofs": "proofs", "protein-structure": "protein-structure", "proteins": "proteins", "proteomics": "proteomics", "ptrace": "ptrace", "pydrake": "pydrake", "pystan": "pystan", "python": "python", "python-extension": "python-extension", "python-migration": "python-migration", "pytorch": "pytorch", "qemu": "qemu", "query-optimization": "query-optimization", "qwen3-coder": "qwen3-coder", "radiochemistry": "radiochemistry", "ray-tracing": "ray-tracing", "rdf": "rdf", "react": "react", "reasoning": "reasoning", "reasoning-model": "reasoning-model", "recovery": "recovery", "reed-solomon": "reed-solomon", "regex": "regex", "reimplementation": "reimplementation", "release-security": "release-security", "report-generation": "report-generation", "research": "research", "retrieval": "retrieval", "retro-computing": "retro-computing", "retro-console": "retro-console", "reverse-engineering": "reverse-engineering", "rocksdb": "rocksdb", "routing": "routing", "rstan": "rstan", "rtl": "rtl", "rule-induction": "rule-induction", "sa-ccr": "sa-ccr", "satb": "satb", "scala": "scala", "scheduling": "scheduling", "schema-mapping": "schema-mapping", "scientific-computing": "scientific-computing", "scipy": "scipy", "security": "security", "session-windows": "session-windows", "sglang": "sglang", "simulation": "simulation", "software-engineering": "software-engineering", "software-installation": "software-installation", "source-maps": "source-maps", "spark": "spark", "sparql": "sparql", "sparql-query": "sparql-query", "spatial-reasoning": "spatial-reasoning", "spcas9": "spcas9", "spectral-methods": "spectral-methods", "spectroscopy": "spectroscopy", "speculative-decoding": "speculative-decoding", "spring_clip": "spring_clip", "sql": "sql", "sql-query": "sql-query", "sqlite": "sqlite", "stan": "stan", "state": "state", "stateful-cli": "stateful-cli", "statistical-filing": "statistical-filing", "statistics": "statistics", "stats": "stats", "storage-engine": "storage-engine", "stream-processing": "stream-processing", "streaming": "streaming", "string-parsing": "string-parsing", "string-rewriting": "string-rewriting", "structural-elucidation": "structural-elucidation", "supramolecular-chemistry": "supramolecular-chemistry", "symbolic-math": "symbolic-math", "sympy": "sympy", "sys-admin": "sys-admin", "system": "system", "system-on-chip": "system-on-chip", "tandem-ms": "tandem-ms", "tariffs": "tariffs", "template-matching": "template-matching", "temporal-reasoning": "temporal-reasoning", "tensor-parallelism": "tensor-parallelism", "tensorflow": "tensorflow", "terminal": "terminal", "text-editing": "text-editing", "theorem-proving": "theorem-proving", "time-series": "time-series", "tokenization": "tokenization", "tool-calling": "tool-calling", "topology": "topology", "topology-optimization": "topology-optimization", "trajectory-optimization": "trajectory-optimization", "transformer": "transformer", "troubleshooting": "troubleshooting", "typescript": "typescript", "typography": "typography", "uefi": "uefi", "userform": "userform", "utility-billing": "utility-billing", "validation": "validation", "vba": "vba", "vector-graphics": "vector-graphics", "verilog": "verilog", "version-control": "version-control", "video-processing": "video-processing", "vigenere": "vigenere", "vim": "vim", "vim-macros": "vim-macros", "virtual-machine": "virtual-machine", "virtualization": "virtualization", "vision": "vision", "vllm": "vllm", "vnc": "vnc", "voice-leading": "voice-leading", "wal": "wal", "warranty": "warranty", "watermarks": "watermarks", "wdm": "wdm", "web": "web", "web-security": "web-security", "web-server": "web-server", "weight-balance": "weight-balance", "windows-3.11": "windows-3.11", "workflow": "workflow", "x86_64": "x86_64", "xss": "xss", "zero-downtime": "zero-downtime" }, "n_tags": 424}123456789101112"""Exact training call used for this model. Run from inside this directory: python train.pySame dim64/epoch10 baseline hyperparams as quality/multilingual, plus loss="ova"(fastText's native multi-label mode): one shared model/vocabulary across all 424 tags,trained jointly, rather than 424 separate binary classifiers -- see README.md."""import fasttext
HPARAMS = dict(dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2_000_000, loss="ova")
model = fasttext.train_supervised(input="train.txt", **HPARAMS)model.save_model("model.bin")print("saved model.bin")123version https://git-lfs.github.com/spec/v1oid sha256:deafd9750d4d82b7209ee453381cc1bacf5dcae49bd125cdbf702f3136ec19afsize 1114536579123version https://git-lfs.github.com/spec/v1oid sha256:19ae51807b1c1d42981ec8d41907bddfa095358e301e59a7e689d6e01348f666size 124512325.gitattributes+8
README.mdAdded+214
multilingual/infer.pyAdded+154
multilingual/model.binAdded+3
multilingual/train.pyAdded+12
multilingual/train.txtAdded+3
multilingual/val.txtAdded+3
quality/__pycache__/infer.cpython-312.pycAdded
quality/infer.pyAdded+153
quality/model.binAdded+3
quality/train.pyAdded+11
quality/train.txtAdded+3
quality/val.txtAdded+3
research_novelty/bins.jsonAdded+28
research_novelty/infer.pyAdded+156
research_novelty/model.binAdded+3
research_novelty/train.pyAdded+12
research_novelty/train.txtAdded+3
research_novelty/val.txtAdded+3
tags/infer.pyAdded+174
tags/model.binAdded+3
tags/tag_vocab.jsonAdded+855
tags/train.pyAdded+12
tags/train.txtAdded+3
tags/val.txtAdded+3