How to measure accuracy while fine-tuning bert-base model?

Hello everybody,

While I am fine-tunning ‘dbmdz/bert-base-turkish-uncased model’, I can see the loss value during training the model as below:

outputs = model(b_input_ids, attention_mask=b_input_mask, labels=b_labels)
loss = outputs[0]  #  get loss

but I could not measure accuracy value during training the model.
any suggestion, please?

1 Like

I’m not sure if it’s possible to print metrics with that object, but with it automatically displays the metrics as in TensorFlow.
Check out the course page

However, I don’t know if it’s possible to include the attention layers here as you do in your example.
    ,batch_size = batch_size
    ,epochs = epochs