AnnyNguyen commited on
Commit
375e1d9
·
verified ·
1 Parent(s): 20d6084

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: vi
3
+ tags:
4
+ - spam-detection
5
+ - vietnamese
6
+ - transformer
7
+ license: apache-2.0
8
+ datasets:
9
+ - visolex/ViSpamReviews
10
+ metrics:
11
+ - accuracy
12
+ - f1
13
+ model-index:
14
+ - name: visobert-spam-classification
15
+ results:
16
+ - task:
17
+ type: text-classification
18
+ name: Spam Detection (Multi-Class)
19
+ dataset:
20
+ name: ViSpamReviews
21
+ type: custom
22
+ metrics:
23
+ - name: Accuracy
24
+ type: accuracy
25
+ value: <INSERT_ACCURACY>
26
+ - name: F1 Score
27
+ type: f1
28
+ value: <INSERT_F1_SCORE>
29
+ base_model:
30
+ - uitnlp/visobert
31
+ pipeline_tag: text-classification
32
+ ---
33
+
34
+ # ViSoBERT-Spam-MultiClass
35
+
36
+ Fine-tuned from [`uitnlp/visobert`](https://huggingface.co/uitnlp/visobert) on **ViSpamReviews** for **multi-class** spam classification.
37
+
38
+ * **Task**: 4-way classification (`SpamLabel`: 0=NO-SPAM, 1=SPAM-1, 2=SPAM-2, 3=SPAM-3)
39
+ * **Dataset**: [ViSpamReviews](https://huggingface.co/datasets/visolex/ViSpamReviews)
40
+ * **Hyperparameters**
41
+
42
+ * Batch size: 32
43
+ * LR: 3e-5
44
+ * Epochs: 100
45
+ * Max seq len: 256
46
+ ## Usage
47
+
48
+ ```python
49
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained("visolex/visobert-spam-classification")
52
+ model = AutoModelForSequenceClassification.from_pretrained("visolex/visobert-spam-classification")
53
+
54
+ text = "Chỉ nói về thương hiệu thôi."
55
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
56
+ pred = model(**inputs).logits.argmax(dim=-1).item()
57
+ label_map = {0: "NO-SPAM",1: "SPAM-1",2: "SPAM-2",3: "SPAM-3"}
58
+ print(label_map[pred])
59
+ ```