Downloads · 30 days
21
6% of all-time downloads
pszemraj/bigbird-roberta-base-edu-classifier
bigbird-roberta-base-edu-classifier is a text classification model from pszemraj. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/
Downloads · 30 days
21
6% of all-time downloads
All-time downloads
350
Public
Parameters
128M
513 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors512 MB · 99%
From the Hugging Face model README
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.
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}
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:
Refer to the hf classifier's model card for more details
The following hyperparameters were used during training: