Text Classification
Transformers
Safetensors
Chinese
bert
Generated from Trainer
classification
nlp
chinese
vulnerability
text-embeddings-inference
Instructions to use CIRCL/vulnerability-severity-classification-chinese-macbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CIRCL/vulnerability-severity-classification-chinese-macbert-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CIRCL/vulnerability-severity-classification-chinese-macbert-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("CIRCL/vulnerability-severity-classification-chinese-macbert-base") model = AutoModelForSequenceClassification.from_pretrained("CIRCL/vulnerability-severity-classification-chinese-macbert-base") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,47 +1,51 @@
|
|
| 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: 1.3186
|
| 22 |
-
- Accuracy: 0.7657
|
| 23 |
-
- F1 Macro: 0.6796
|
| 24 |
-
- Low Precision: 0.5544
|
| 25 |
-
- Low Recall: 0.3987
|
| 26 |
-
- Low F1: 0.4638
|
| 27 |
-
- Medium Precision: 0.7805
|
| 28 |
-
- Medium Recall: 0.8196
|
| 29 |
-
- Medium F1: 0.7996
|
| 30 |
-
- High Precision: 0.7787
|
| 31 |
-
- High Recall: 0.7720
|
| 32 |
-
- High F1: 0.7753
|
| 33 |
|
| 34 |
-
##
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
|
|
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
More information needed
|
| 45 |
|
| 46 |
## Training procedure
|
| 47 |
|
|
@@ -56,6 +60,20 @@ The following hyperparameters were used during training:
|
|
| 56 |
- lr_scheduler_type: linear
|
| 57 |
- num_epochs: 5
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
### Training results
|
| 60 |
|
| 61 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | Low Precision | Low Recall | Low F1 | Medium Precision | Medium Recall | Medium F1 | High Precision | High Recall | High F1 |
|
|
|
|
| 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 |
## Training procedure
|
| 51 |
|
|
|
|
| 60 |
- lr_scheduler_type: linear
|
| 61 |
- num_epochs: 5
|
| 62 |
|
| 63 |
+
It achieves the following results on the evaluation set:
|
| 64 |
+
- Loss: 1.3186
|
| 65 |
+
- Accuracy: 0.7657
|
| 66 |
+
- F1 Macro: 0.6796
|
| 67 |
+
- Low Precision: 0.5544
|
| 68 |
+
- Low Recall: 0.3987
|
| 69 |
+
- Low F1: 0.4638
|
| 70 |
+
- Medium Precision: 0.7805
|
| 71 |
+
- Medium Recall: 0.8196
|
| 72 |
+
- Medium F1: 0.7996
|
| 73 |
+
- High Precision: 0.7787
|
| 74 |
+
- High Recall: 0.7720
|
| 75 |
+
- High F1: 0.7753
|
| 76 |
+
|
| 77 |
### Training results
|
| 78 |
|
| 79 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | Low Precision | Low Recall | Low F1 | Medium Precision | Medium Recall | Medium F1 | High Precision | High Recall | High F1 |
|