Update README.md
Browse files
README.md
CHANGED
@@ -16,24 +16,48 @@ 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.5058
|
22 |
- Accuracy: 0.8269
|
23 |
|
24 |
## Model description
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
### Training hyperparameters
|
39 |
|
|
|
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 the dataset [CIRCL/vulnerability-scores](https://huggingface.co/datasets/CIRCL/vulnerability-scores).
|
20 |
+
|
21 |
+
|
22 |
It achieves the following results on the evaluation set:
|
23 |
- Loss: 0.5058
|
24 |
- Accuracy: 0.8269
|
25 |
|
26 |
## Model description
|
27 |
|
28 |
+
It is a classification model and is aimed to assist in classifying vulnerabilities by severity based on their descriptions.
|
29 |
+
|
30 |
+
|
31 |
+
## How to get started with the model
|
32 |
+
|
33 |
+
```python
|
34 |
+
>>> from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
35 |
+
... import torch
|
36 |
+
...
|
37 |
+
... labels = ["low", "medium", "high", "critical"]
|
38 |
+
...
|
39 |
+
... model_name = "CIRCL/vulnerability-severity-classification-distilbert-base-uncased"
|
40 |
+
... tokenizer = AutoTokenizer.from_pretrained(model_name)
|
41 |
+
... model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
42 |
+
... model.eval()
|
43 |
+
...
|
44 |
+
... test_description = "SAP NetWeaver Visual Composer Metadata Uploader is not protected with a proper authorization, allowing unauthenticated agent to upload potentially malicious executable binaries \
|
45 |
+
that could severely harm the host system. This could significantly affect the confidentiality, integrity, and availability of the targeted system."
|
46 |
+
... inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True)
|
47 |
+
...
|
48 |
+
... # Run inference
|
49 |
+
... with torch.no_grad():
|
50 |
+
... outputs = model(**inputs)
|
51 |
+
... predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
52 |
+
...
|
53 |
+
... # Print results
|
54 |
+
... print("Predictions:", predictions)
|
55 |
+
... predicted_class = torch.argmax(predictions, dim=-1).item()
|
56 |
+
... print("Predicted severity:", labels[predicted_class])
|
57 |
+
...
|
58 |
+
Predictions: tensor([[4.9335e-04, 3.4782e-02, 2.6257e-01, 7.0215e-01]])
|
59 |
+
Predicted severity: critical
|
60 |
+
```
|
61 |
|
62 |
### Training hyperparameters
|
63 |
|