inference4j/distilbert-base-uncased-finetuned-sst-2-english
By inference4j · ↓ 15 · ♥ 0 · Updated 2026-02-13
What's in this repo
This page lists the files in inference4j/distilbert-base-uncased-finetuned-sst-2-english, including model.onnx.
- 1 ONNX models (.onnx files)
- 5 files, including 1 .md, 1 .json, 1 .onnx, 1 .txt
- Last updated 2026-02-13
ONNX files
| File | Size | Download |
|---|---|---|
| model.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
DistilBERT SST-2 — ONNX
ONNX export of distilbert-base-uncased-finetuned-sst-2-english, a DistilBERT model fine-tuned on the Stanford Sentiment Treebank (SST-2) for binary sentiment classification (POSITIVE/NEGATIVE).
Mirrored for use with inference4j, an inference-only AI library for Java.
Original Source
- Repository: Xenova (originally distilbert-base by HuggingFace)
- License: apache-2.0
Usage with inference4j
try (DistilBertClassifier model = DistilBertClassifier.fromPretrained("models/distilbert-sst2")) {
List<TextClassification> results = model.classify("This movie was fantastic!");
System.out.println(results.get(0).label()); // "POSITIVE"
System.out.printf("Score: %.4f%n", results.get(0).score());
}
Model Details
| Property | Value |
|---|---|
| Architecture | DistilBERT (6 layers, 768 hidden) |
| Task | Binary sentiment classification (POSITIVE / NEGATIVE) |
| Training data | SST-2 (Stanford Sentiment Treebank) |
| Max sequence length | 512 |
| Original framework | PyTorch (HuggingFace Transformers) |
| ONNX export | By Xenova (Transformers.js) |
License
This model is licensed under the Apache License 2.0. Original model by HuggingFace, ONNX export by Xenova.
Model info
Created: 2026-02-13
Updated: 2026-02-13
View on Hugging Face