cedricbonhomme commited on
Commit
5373cce
·
verified ·
1 Parent(s): 64fb2f1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -6
README.md CHANGED
@@ -16,22 +16,47 @@ 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 an unknown dataset.
 
 
 
20
  It achieves the following results on the evaluation set:
21
  - Loss: 0.5141
22
  - Accuracy: 0.8267
23
 
24
  ## Model description
25
 
26
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- ## Intended uses & limitations
 
 
29
 
30
- More information needed
 
 
 
31
 
32
- ## Training and evaluation data
 
 
 
 
33
 
34
- More information needed
35
 
36
  ## Training procedure
37
 
 
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
+ You can read [this page](https://www.vulnerability-lookup.org/user-manual/ai/) for more information.
22
+
23
  It achieves the following results on the evaluation set:
24
  - Loss: 0.5141
25
  - Accuracy: 0.8267
26
 
27
  ## Model description
28
 
29
+ It is a classification model and is aimed to assist in classifying vulnerabilities by severity based on their descriptions.
30
+
31
+
32
+ ## How to get started with the model
33
+
34
+ ```python
35
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
36
+ import torch
37
+
38
+ labels = ["low", "medium", "high", "critical"]
39
+
40
+ model_name = "CIRCL/vulnerability-severity-classification-distilbert-base-uncased"
41
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
42
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
43
+ model.eval()
44
 
45
+ test_description = "SAP NetWeaver Visual Composer Metadata Uploader is not protected with a proper authorization, allowing unauthenticated agent to upload potentially malicious executable binaries \
46
+ that could severely harm the host system. This could significantly affect the confidentiality, integrity, and availability of the targeted system."
47
+ inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True)
48
 
49
+ # Run inference
50
+ with torch.no_grad():
51
+ outputs = model(**inputs)
52
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
53
 
54
+ # Print results
55
+ print("Predictions:", predictions)
56
+ predicted_class = torch.argmax(predictions, dim=-1).item()
57
+ print("Predicted severity:", labels[predicted_class])
58
+ ```
59
 
 
60
 
61
  ## Training procedure
62