CoolFace
Modelpublic

inference4j/distilbert-base-uncased-finetuned-sst-2-english

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
1likes19downloads
Model Card

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

Usage with inference4j

java
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

PropertyValue
ArchitectureDistilBERT (6 layers, 768 hidden)
TaskBinary sentiment classification (POSITIVE / NEGATIVE)
Training dataSST-2 (Stanford Sentiment Treebank)
Max sequence length512
Original frameworkPyTorch (HuggingFace Transformers)
ONNX exportBy Xenova (Transformers.js)

License

This model is licensed under the Apache License 2.0. Original model by HuggingFace, ONNX export by Xenova.