Update README.md
Browse files
README.md
CHANGED
@@ -9,31 +9,51 @@ metrics:
|
|
9 |
model-index:
|
10 |
- name: vulnerability-severity-classification-roberta-base
|
11 |
results: []
|
|
|
|
|
12 |
---
|
13 |
|
14 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
15 |
-
should probably proofread and complete it, then remove this comment. -->
|
16 |
-
|
17 |
# vulnerability-severity-classification-roberta-base
|
18 |
|
19 |
-
This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on
|
|
|
20 |
It achieves the following results on the evaluation set:
|
21 |
- Loss: 0.5372
|
22 |
- Accuracy: 0.8138
|
23 |
|
24 |
## Model description
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
|
|
29 |
|
30 |
-
|
|
|
|
|
|
|
31 |
|
32 |
-
## Training and evaluation data
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
## Training procedure
|
37 |
|
38 |
### Training hyperparameters
|
39 |
|
@@ -62,4 +82,4 @@ The following hyperparameters were used during training:
|
|
62 |
- Transformers 4.49.0
|
63 |
- Pytorch 2.6.0+cu124
|
64 |
- Datasets 3.3.2
|
65 |
-
- Tokenizers 0.21.0
|
|
|
9 |
model-index:
|
10 |
- name: vulnerability-severity-classification-roberta-base
|
11 |
results: []
|
12 |
+
datasets:
|
13 |
+
- CIRCL/vulnerability-scores
|
14 |
---
|
15 |
|
|
|
|
|
|
|
16 |
# vulnerability-severity-classification-roberta-base
|
17 |
|
18 |
+
This model is a fine-tuned version of [roberta-base](https://huggingface.co/FacebookAI/roberta-base) on a the dataset [CIRCL/vulnerability-scores](https://huggingface.co/datasets/CIRCL/vulnerability-scores).
|
19 |
+
|
20 |
It achieves the following results on the evaluation set:
|
21 |
- Loss: 0.5372
|
22 |
- Accuracy: 0.8138
|
23 |
|
24 |
## Model description
|
25 |
|
26 |
+
It is a classification model and is aimed to assist in classifying vulnerabilities by severity based on their descriptions.
|
27 |
+
|
28 |
+
|
29 |
+
## How to get started with the model
|
30 |
+
|
31 |
+
```python
|
32 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
33 |
+
import torch
|
34 |
+
|
35 |
+
labels = ["low", "medium", "high", "critical"]
|
36 |
+
|
37 |
+
model_name = "CIRCL/vulnerability-severity-classification-roberta-base"
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
39 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
40 |
+
model.eval()
|
41 |
|
42 |
+
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."
|
43 |
+
inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True)
|
44 |
|
45 |
+
# Run inference
|
46 |
+
with torch.no_grad():
|
47 |
+
outputs = model(**inputs)
|
48 |
+
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
49 |
|
|
|
50 |
|
51 |
+
# Print results
|
52 |
+
print("Predictions:", predictions)
|
53 |
+
predicted_class = torch.argmax(predictions, dim=-1).item()
|
54 |
+
print("Predicted severity:", labels[predicted_class])
|
55 |
+
```
|
56 |
|
|
|
57 |
|
58 |
### Training hyperparameters
|
59 |
|
|
|
82 |
- Transformers 4.49.0
|
83 |
- Pytorch 2.6.0+cu124
|
84 |
- Datasets 3.3.2
|
85 |
+
- Tokenizers 0.21.0
|