Text Classification
Transformers
Safetensors
roberta
Generated from Trainer
classification
nlp
vulnerability
text-embeddings-inference
Instructions to use CIRCL/vulnerability-severity-classification-roberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CIRCL/vulnerability-severity-classification-roberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CIRCL/vulnerability-severity-classification-roberta-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("CIRCL/vulnerability-severity-classification-roberta-base") model = AutoModelForSequenceClassification.from_pretrained("CIRCL/vulnerability-severity-classification-roberta-base") - Inference
- Notebooks
- Google Colab
- Kaggle
metadata
library_name: transformers
license: mit
base_model: roberta-base
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: vulnerability-severity-classification-roberta-base
results: []
datasets:
- CIRCL/vulnerability-scores
vulnerability-severity-classification-roberta-base
This model is a fine-tuned version of roberta-base on the dataset CIRCL/vulnerability-scores.
It achieves the following results on the evaluation set:
- Loss: 0.5087
- Accuracy: 0.8286
Model description
It is a classification model and is aimed to assist in classifying vulnerabilities by severity based on their descriptions.
How to get started with the model
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
labels = ["low", "medium", "high", "critical"]
model_name = "CIRCL/vulnerability-scores"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
test_description = "langchain_experimental 0.0.14 allows an attacker to bypass the CVE-2023-36258 fix and execute arbitrary code via the PALChain in the python exec method."
inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True)
# Run inference
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
# Print results
print("Predictions:", predictions)
predicted_class = torch.argmax(predictions, dim=-1).item()
print("Predicted severity:", labels[predicted_class])
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 5
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.6379 | 1.0 | 26871 | 0.6473 | 0.7292 |
| 0.4942 | 2.0 | 53742 | 0.5829 | 0.7669 |
| 0.4624 | 3.0 | 80613 | 0.5428 | 0.7982 |
| 0.3467 | 4.0 | 107484 | 0.5104 | 0.8187 |
| 0.4102 | 5.0 | 134355 | 0.5087 | 0.8286 |
Framework versions
- Transformers 4.51.3
- Pytorch 2.7.0+cu126
- Datasets 3.5.0
- Tokenizers 0.21.1