Edit model card

Visualize in Weights & Biases

bigbird-roberta-base: eduscore

Similar to the original, this model predicts a score of 0 to 5 on 'educational quality' of some text. This model was fine-tuned @ its max context length of 4096 tokens.

Usage

Note this is for CPU, for GPU you will need to make some (small) changes.

# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_name = "pszemraj/bigbird-roberta-base-edu-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
    model_name, attn_implementation="eager"
)

text = "This is a test sentence."
inputs = tokenizer(text, return_tensors="pt", padding="longest", truncation=True)
outputs = model(**inputs)
logits = outputs.logits.squeeze(-1).float().detach().numpy()
score = logits.item()
result = {
    "text": text,
    "score": score,
    "int_score": int(round(max(0, min(score, 5)))),
}

print(result)
# {'text': 'This is a test sentence.', 'score': 0.20170727372169495, 'int_score': 0}

Details

This model is a fine-tuned version of google/bigbird-roberta-base on the HuggingFaceFW/fineweb-edu-llama3-annotations dataset. It achieves the following results on the evaluation set:

  • Loss: 0.2176
  • Mse: 0.2176

Intended uses & limitations

Refer to the hf classifier's model card for more details

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 1e-05
  • train_batch_size: 4
  • eval_batch_size: 4
  • seed: 90085
  • gradient_accumulation_steps: 32
  • total_train_batch_size: 128
  • optimizer: Adam with betas=(0.9,0.98) and epsilon=1e-09
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_ratio: 0.05
  • num_epochs: 1.0
Downloads last month
15
Safetensors
Model size
128M params
Tensor type
F32
·
Inference Examples
Inference API (serverless) has been turned off for this model.

Model tree for pszemraj/bigbird-roberta-base-edu-classifier

Finetuned
(15)
this model

Dataset used to train pszemraj/bigbird-roberta-base-edu-classifier