Downloads · 30 days
10
19% of all-time downloads
PeytonT/research-library-c2-v2
research-library-c2-v2 is a feature extraction model from PeytonT. Use it when you need embeddings to search or compare text. It is set up for transformers.
Scores and embeds paper/repository pairs for mapping paper methods and descriptions to repository functions, files, or code spans.
Downloads · 30 days
10
19% of all-time downloads
All-time downloads
53
Public
Parameters
22.7M
90.9 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors90.9 MB · 99%
From the Hugging Face model README
Scores and embeds paper/repository pairs for mapping paper methods and descriptions to repository functions, files, or code spans.
sentence-transformers/all-MiniLM-L6-v2C2T5_crossv2This model is part of the Repository Library stack, a research system for indexing, retrieving, aligning, and reasoning over scientific papers, structured paper content, repositories, and cross-domain links between them.
The training inputs for this package were assembled from the following Repository Library data sources:
paper_repo_pairs: paper/repository pair records from the Repository Library alignment pipeline.exports/paper_repo_span_align.jsonlThe v2 hardening pass applies:
dedupe: truebalance_binary: truepairs_min_chars=64, pairs_max_chars=131072paper_repo_pairs[0.9, 0.1, 0.0]bf16contrastiveauto5e-05full_finetuneeval_roc_aucddpDeclared metrics: recall_at_10, ndcg_at_10
Tracked v2 eval metrics on the current held-out split:
eval_loss: 0.4323210120201111eval_pair_accuracy: 0.4838709677419355eval_positive_score_mean: 0.42978216651827095eval_negative_score_mean: 0.3917496839421801eval_score_margin_mean: 0.03803248257609082eval_roc_auc: 0.5416666666666666eval_best_pair_accuracy: 0.5967741935483871eval_best_threshold: 0.2927139103412628Status: this card reflects the current tracked experiment configuration and packaged weights in the Repository Library model stack. The v2 checkpoint loads from the trainer-selected best checkpoint. Current quality is modest and indicates that further pair curation, stronger positives, and cleaner hard negatives are still needed.
import torch
from transformers import AutoModel, AutoTokenizer
repo_id = "PeytonT/repo-paper-alignment"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModel.from_pretrained(repo_id)
model.eval()
def mean_pool(last_hidden_state, attention_mask):
mask = attention_mask.unsqueeze(-1).type_as(last_hidden_state)
return (last_hidden_state * mask).sum(dim=1) / mask.sum(dim=1).clamp_min(1.0)
def encode(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256, padding=True)
with torch.no_grad():
outputs = model(**inputs)
return torch.nn.functional.normalize(mean_pool(outputs.last_hidden_state, inputs["attention_mask"]), dim=-1)
paper = "PAPER: We introduce a contrastive method for aligning scientific methods to implementation spans."
repo = "REPOSITORY: This module builds pairwise paper-code alignment examples and trains a contrastive encoder."
score = torch.nn.functional.cosine_similarity(encode(paper), encode(repo)).item()
print(score)
eval_roc_auc around 0.542), so this checkpoint should be treated as a research component and not a final alignment benchmark.