Hi,
You can check out the code example in the docs of TFDistilBertForSequenceClassification.
The model outputs logits, which are unnormalized scores for each of the classes, for every example in the batch. It’s a tensor of shape (batch_size, num_labels).
To turn it into an actual prediction, one takes the highest score, as follows:
from transformers import DistilBertTokenizer, TFDistilBertForSequenceClassification
import tensorflow as tf

tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
model = TFDistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased')

inputs = tokenizer("Hello world ", return_tensors="tf")

outputs = model(inputs)
logits = outputs.logits
predicted_class_idx = tf.math.argmax(logits, axis=-1)[0]
print("Predicted class:", model.config.id2label[int(predicted_class_idx)])

Note that you can set the id2label dictionary as an attribute of the model’s configuration, to map integers to actual class names.