CoolFace
Modelpublic

yusenthebot/distilbert_food_text_artifacts

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes10downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

distilbertfoodtext_artifacts

This model is a fine-tuned version of distilbert-base-uncased on the None dataset. It achieves the following results on the evaluation set:

  • Loss: 0.0155
  • Accuracy: 1.0
  • Precision: 1.0
  • Recall: 1.0
  • F1: 1.0

Model description

This model classifies short food descriptions into semantic classes (e.g., Dish, Ingredient, Beverage). It was fine-tuned on the augmented split and evaluated on both the test subset of augmented and the original split as an external validation set.

Dataset

  • HF dataset: aedupuga/food-description-text (splits: augmented, original)
  • We discover the label set dynamically from both splits to stay consistent with the dataset card.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • trainbatchsize: 8
  • evalbatchsize: 8
  • seed: 42
  • optimizer: Use OptimizerNames.ADAMWTORCHFUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lrschedulertype: linear
  • num_epochs: 5

Training results

Training LossEpochStepValidation LossAccuracyPrecisionRecallF1
0.10811.0800.09470.9750.97880.9750.9698
0.01822.01600.01391.01.01.01.0
0.01183.02400.00771.01.01.01.0
0.00854.03200.00591.01.01.01.0
0.00685.04000.00541.01.01.01.0

Framework versions

  • Transformers 4.56.1
  • Pytorch 2.8.0+cu126
  • Datasets 4.0.0
  • Tokenizers 0.22.0

Quickstart

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch, numpy as np

model_id = "{cfg.HUB_REPO_ID}"
tok = AutoTokenizer.from_pretrained(model_id)
mdl = AutoModelForSequenceClassification.from_pretrained(model_id)
mdl.eval()

text = "Orange juice is made by squeezing oranges."
inputs = tok(text, return_tensors="pt", truncation=True)
with torch.no_grad():
    logits = mdl(**inputs).logits
probs = torch.softmax(logits, dim=-1)[0].detach().numpy()
pred = int(np.argmax(probs))
print(pred, mdl.config.id2label[pred], probs[pred])