michaljach commited on
Commit
5805ce7
·
verified ·
1 Parent(s): 2934895

Organization card

Browse files
Files changed (2) hide show
  1. README.md +60 -3
  2. logo.svg +48 -0
README.md CHANGED
@@ -1,10 +1,67 @@
1
  ---
2
  title: README
3
- emoji: 🏆
4
  colorFrom: blue
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: README
3
+ emoji: 🔵
4
  colorFrom: blue
5
+ colorTo: indigo
6
  sdk: static
7
  pinned: false
8
  ---
9
 
10
+ <p align="center">
11
+ <img src="https://huggingface.co/spaces/nodd-repo/README/resolve/main/logo.svg" alt="nodd" width="96">
12
+ </p>
13
+
14
+ <h1 align="center">nodd</h1>
15
+
16
+ <p align="center">
17
+ <b>Tiny, calibrated classifiers that run in your browser.</b><br>
18
+ One decision → one ~24 MB model: offline, no per-call cost, and it knows when it is unsure.
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="https://michaljach.github.io/nodd/">Live demo</a> ·
23
+ <a href="https://michaljach.github.io/nodd/docs.html">Docs</a> ·
24
+ <a href="https://github.com/michaljach/nodd">GitHub</a> ·
25
+ <a href="https://www.npmjs.com/package/@nodd/browser">@nodd/browser</a> ·
26
+ <a href="https://www.npmjs.com/package/@nodd/node">@nodd/node</a>
27
+ </p>
28
+
29
+ ---
30
+
31
+ Each model here is a MiniLM encoder fine-tuned for **one** task, exported to int8 ONNX and
32
+ checked for parity against Python. Every prediction comes with a **calibrated** confidence: above
33
+ the threshold the model decides alone, below it you escalate to a bigger model.
34
+
35
+ | Model | Decides | Labels | Test macro-F1 | Handled alone* |
36
+ |---|---|---|---|---|
37
+ | [comment-moderation](https://huggingface.co/nodd-repo/comment-moderation) | Can this blog comment be published? | `ok` `spam` `toxic` | 0.952 | 94% |
38
+ | [prompt-injection](https://huggingface.co/nodd-repo/prompt-injection) | Is this message trying to hijack an AI assistant? | `safe` `injection` | 0.961 | 100% |
39
+ | [sentiment](https://huggingface.co/nodd-repo/sentiment) | What feeling does the writer express? | `positive` `neutral` `negative` | 0.882 | 90% |
40
+ | [support-triage](https://huggingface.co/nodd-repo/support-triage) | Which queue should this support message go to? | `billing` `bug` `account` `how_to` `feature_request` | 0.901 | 44% |
41
+
42
+ <sub>*Share of validation inputs above the confidence threshold, which is set for ≥ 97% precision.
43
+ Trained on synthetic data: expect lower numbers on real traffic.</sub>
44
+
45
+ ### Use
46
+
47
+ ```sh
48
+ hf download nodd-repo/comment-moderation --local-dir public/models/comment_moderation/v3
49
+ npm install @nodd/browser # or @nodd/node on a server
50
+ ```
51
+
52
+ ```ts
53
+ import { nodd } from "@nodd/browser";
54
+
55
+ const m = await nodd.load("/models/comment_moderation/v3");
56
+ const d = await m.decide("Buy cheap followers at ..."); // { label: "spam", confidence: 0.99, ... }
57
+ if (!m.isConfident(d)) { /* escalate to a bigger model */ }
58
+ ```
59
+
60
+ ### Make your own
61
+
62
+ Write a short YAML spec (the input and a fixed set of labels), and `nodd` collects data, labels it
63
+ with a teacher model, trains, calibrates and exports a browser-ready model, all on CPU.
64
+
65
+ ```sh
66
+ uv run nodd run examples/comment_moderation.yaml
67
+ ```
logo.svg ADDED