Views
No views yet
| Metric | Pre-trained | Fine-tuned |
|---|---|---|
| Accuracy | 77.6% | 98.8% |
| False negatives | 71 | 4 |
| False positives | 1 | 0 |
| Category | Pre-trained | Fine-tuned |
|---|---|---|
| Encoding evasion | 51.3% | 100% |
| Shell injection | 73.3% | 100% |
| Authority spoofing | 82.1% | 100% |
| Path traversal | 64.0% | 96.0% |
| Data exfiltration | 86.1% | 100% |
| Prompt injection | 92.8% | 97.9% |
openparallax get-classifier1import * as ort from "onnxruntime-node";
2import { Tokenizer } from "tokenizers";
3
4const session = await ort.InferenceSession.create("model.onnx");
5const tokenizer = Tokenizer.fromFile("tokenizer.json");
6
7const encoded = await tokenizer.encode("your text here");
8const inputIds = new ort.Tensor("int64", BigInt64Array.from(encoded.getIds().map(BigInt)), [1, encoded.getIds().length]);
9const attentionMask = new ort.Tensor("int64", BigInt64Array.from(encoded.getAttentionMask().map(BigInt)), [1, encoded.getAttentionMask().length]);
10
11const results = await session.run({ input_ids: inputIds, attention_mask: attentionMask });
12// logits[0] = SAFE probability, logits[1] = INJECTION probability