DistilBERT Sentiment Classifier (Teeny-Tiny Castle)

This model is part of a tutorial tied to the Teeny-Tiny Castle, an open-source repository containing educational tools for AI Ethics and Safety research.

How to Use

from transformers import TFAutoModelForSequenceClassification, AutoTokenizer
from transformers import TextClassificationPipeline

# Load the model and tokenizer
model = TFAutoModelForSequenceClassification.from_pretrained("AiresPucrs/distilbert-base-cased-sentiment-classifier")
tokenizer = AutoTokenizer.from_pretrained("AiresPucrs/distilbert-base-cased-sentiment-classifier")

# Create a text classification pipeline
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)

# Classify some samples
texts = [
    'Is to complicated and boring.',
    'Is nice to see philosophers doing machine learning.',
 ]

for text in texts:
 preds = pipeline(text)

  print(f"""\nReview: '{text}'\n(Label: {preds[0]['label']} | Confidence: {preds[0]['score'] * 100:.2f}%)""")
Downloads last month
7
Safetensors
Model size
65.8M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.