Views
No views yet
0 = sophisticated1 = simpledata/data-snapshot-mixed-20250114.jsonl (snapshot prepared for this project)training_results.json for full logs and per-model results.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_path = "models/deberta_v3_xsmall_new"
5tokenizer = AutoTokenizer.from_pretrained(model_path)
6model = AutoModelForSequenceClassification.from_pretrained(model_path)
7model.eval()
8
9def classify(text, max_length=512, device='cpu'):
10 inputs = tokenizer(text, truncation=True, padding=True, max_length=max_length, return_tensors='pt')
11 inputs = {k: v.to(device) for k, v in inputs.items()}
12 with torch.no_grad():
13 out = model(**inputs)
14 probs = torch.softmax(out.logits, dim=1)
15 # Model encoding: 0 = sophisticated, 1 = simple
16 prob_soph = probs[0, 0].item()
17 prob_simple = probs[0, 1].item()
18 is_sophisticated = prob_soph > prob_simple
19 return {
20 'is_sophisticated': bool(is_sophisticated),
21 'prob_sophisticated': prob_soph,
22 'prob_simple': prob_simple
23 }model.safetensors — model weights (tracked with Git LFS)tokenizer.json, spm.model — tokenizer filesconfig.json — model configurationApache-2.0 or CC BY-NC).data/data-snapshot-mixed-20250114.jsonl.modelcard.json in the same folder.