Update README.md
Browse files
README.md
CHANGED
|
@@ -1,37 +1,52 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
license: apache-2.0
|
| 4 |
-
base_model: hfl/chinese-macbert-base
|
| 5 |
-
tags:
|
| 6 |
-
- generated_from_trainer
|
| 7 |
metrics:
|
| 8 |
- accuracy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
model-index:
|
| 10 |
- name: vulnerability-severity-classification-chinese-macbert-base
|
| 11 |
results: []
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
| 15 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
This model is a fine-tuned version of [hfl/chinese-macbert-base](https://huggingface.co/hfl/chinese-macbert-base) on an unknown dataset.
|
| 20 |
-
It achieves the following results on the evaluation set:
|
| 21 |
-
- Loss: 0.6044
|
| 22 |
-
- Accuracy: 0.7745
|
| 23 |
|
| 24 |
-
##
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
## Training and evaluation data
|
| 33 |
|
| 34 |
-
More information needed
|
| 35 |
|
| 36 |
## Training procedure
|
| 37 |
|
|
@@ -46,6 +61,10 @@ The following hyperparameters were used during training:
|
|
| 46 |
- lr_scheduler_type: linear
|
| 47 |
- num_epochs: 5
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
### Training results
|
| 50 |
|
| 51 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: hfl/chinese-macbert-base
|
| 3 |
+
datasets:
|
| 4 |
+
- CIRCL/Vulnerability-CNVD
|
| 5 |
library_name: transformers
|
| 6 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 7 |
metrics:
|
| 8 |
- accuracy
|
| 9 |
+
tags:
|
| 10 |
+
- generated_from_trainer
|
| 11 |
+
- text-classification
|
| 12 |
+
- classification
|
| 13 |
+
- nlp
|
| 14 |
+
- chinese
|
| 15 |
+
- vulnerability
|
| 16 |
+
pipeline_tag: text-classification
|
| 17 |
+
language: zh
|
| 18 |
model-index:
|
| 19 |
- name: vulnerability-severity-classification-chinese-macbert-base
|
| 20 |
results: []
|
| 21 |
---
|
| 22 |
|
| 23 |
+
# VLAI: A RoBERTa-Based Model for Automated Vulnerability Severity Classification (Chinese Text)
|
|
|
|
| 24 |
|
| 25 |
+
This model is a fine-tuned version of [hfl/chinese-macbert-base](https://huggingface.co/hfl/chinese-macbert-base) on the dataset [CIRCL/Vulnerability-CNVD](https://huggingface.co/datasets/CIRCL/Vulnerability-CNVD).
|
| 26 |
+
|
| 27 |
+
For more information, visit the [Vulnerability-Lookup project page](https://vulnerability.circl.lu) or the [ML-Gateway GitHub repository](https://github.com/vulnerability-lookup/ML-Gateway), which demonstrates its usage in a FastAPI server.
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
## How to use
|
| 31 |
|
| 32 |
+
You can use this model directly with the Hugging Face `transformers` library for text classification:
|
| 33 |
|
| 34 |
+
```python
|
| 35 |
+
from transformers import pipeline
|
| 36 |
|
| 37 |
+
classifier = pipeline(
|
| 38 |
+
"text-classification",
|
| 39 |
+
model="CIRCL/vulnerability-severity-classification-chinese-macbert-base"
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# Example usage for a Chinese vulnerability description
|
| 43 |
+
description_chinese = "TOTOLINK A3600R是中国吉翁电子(TOTOLINK)公司的一款6天线1200M无线路由器。TOTOLINK A3600R存在缓冲区溢出漏洞,该漏洞源于/cgi-bin/cstecgi.cgi文件的UploadCustomModule函数中的File参数未能正确验证输入数据的长度大小,攻击者可利用该漏洞在系统上执行任意代码或者导致拒绝服务。"
|
| 44 |
+
result_chinese = classifier(description_chinese)
|
| 45 |
+
print(result_chinese)
|
| 46 |
+
# Expected output example: [{'label': '高', 'score': 0.9802}]
|
| 47 |
+
```
|
| 48 |
|
|
|
|
| 49 |
|
|
|
|
| 50 |
|
| 51 |
## Training procedure
|
| 52 |
|
|
|
|
| 61 |
- lr_scheduler_type: linear
|
| 62 |
- num_epochs: 5
|
| 63 |
|
| 64 |
+
It achieves the following results on the evaluation set:
|
| 65 |
+
- Loss: 0.6044
|
| 66 |
+
- Accuracy: 0.7745
|
| 67 |
+
|
| 68 |
### Training results
|
| 69 |
|
| 70 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|