Instructions to use nodd-repo/comment-moderation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use nodd-repo/comment-moderation with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'nodd-repo/comment-moderation');
comment_moderation (v4)
Decide whether a user comment on a product blog is acceptable to publish.
A small classifier trained with nodd, exported as ONNX fp32 and int8 for browser and Node.js inference. This version uses a larger offline synthetic training dataset.
| Label | Meaning |
|---|---|
ok |
Normal comment. Can be positive, negative or off topic, but harmless. |
spam |
Ads, links to unrelated products or services, SEO junk, scams. |
toxic |
Insults, harassment, threats or hate toward people or groups. |
Evaluation
| Metric | Value |
|---|---|
| Test macro F1, PyTorch | 0.9339 |
| Test macro F1, int8 ONNX | 0.9345 |
| int8 vs PyTorch label agreement | 97.28% |
| int8 download | 24.31 MB |
| Train / validation / test | 4197 / 257 / 257 |
| Temperature | 1.299944 |
| Confidence threshold | 0.730609 |
| Validation precision at threshold | 97.15% |
| Test accuracy on covered inputs, PyTorch | 95.56% |
| Test coverage, PyTorch | 96.50% |
| Training seed | 42 |
See baseline comparison, evaluation report, and browser parity results.
Data and limitations
Added 1,000 examples per label using deterministic offline templates, with generation seed 20260928. Labels were assigned by construction, not by an independent teacher. Template variants are correlated and do not represent independent scenarios. New rows are training-only; the original validation and test records were preserved. Exact duplicates and examples with embedding cosine similarity above 0.90 to either holdout were rejected.
All evaluation inputs are synthetic; real-world accuracy is unmeasured. More data did not consistently improve held-out quality: consult the comparison before replacing an earlier version. The 97% precision target selected on validation was not met on this version's covered PyTorch test subset. Quantization can change individual probabilities substantially, so label parity does not establish confidence equivalence. Prompt-injection detection, where applicable, is not a standalone security boundary.
Use
Download this version and serve it from your own origin:
hf download nodd-repo/comment-moderation --revision v4 --local-dir public/models/comment_moderation/v4
npm install @nodd/browser
import { nodd } from "@nodd/browser";
const model = await nodd.load("/models/comment_moderation/v4");
const decision = await model.decide("Your input text");
if (!model.isConfident(decision)) { /* escalate for review */ }
model.dispose();
For Node.js, use @nodd/node and the downloaded directory path. Requires nodd JavaScript packages >= 0.2.0.
Artifacts
onnx/model_quantized.onnx,onnx/model.onnx: int8 and fp32 browser models.nodd.json, tokenizer files andconfig.json: browser runtime configuration.encoder/: original Transformers checkpoint, loadable withAutoModelForSequenceClassification.from_pretrained(local_path, subfolder="encoder").labeled.jsonl: exact training, validation and test records with split and provenance fields.synthetic_manifest.json: generation metadata and baseline fingerprint.model_card.json, reports and parity files: training, calibration and evaluation evidence.
Earlier releases remain available through their version tags. The generation script and cross-task results are in the source repository.
- Downloads last month
- 29
Model tree for nodd-repo/comment-moderation
Base model
nreimers/MiniLM-L6-H384-uncased