File size: 1,877 Bytes
717480f
a9bed31
 
4196e78
717480f
 
8e0a50f
717480f
8e0a50f
717480f
8d9ce9f
 
 
 
 
 
 
717480f
97d4402
 
04609a3
 
 
 
 
 
 
 
 
 
b0ce383
04609a3
97d4402
 
 
 
 
 
 
 
 
 
 
0fd40e2
c952daf
 
 
 
 
 
 
 
 
 
 
 
 
 
24171af
97d4402
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
language:
- ms
library_name: transformers
---

Safe for Work Classifier Model for Malaysian Data

Current version supports Malay. We are working towards supporting malay, english and indo.

Base Model finetuned from https://huggingface.co/mesolitica/malaysian-mistral-191M-MLM-512 with Malaysian NSFW data.

Data Source: https://huggingface.co/datasets/malaysia-ai/Malaysian-NSFW

Github Repo: https://github.com/malaysia-ai/sfw-classifier

Project Board: https://github.com/orgs/malaysia-ai/projects/6

![Image in a markdown cell](https://github.com/mesolitica/malaysian-llmops/raw/main/e2e.png)

Current Labels Available:

- religion insult
- sexist
- racist
- psychiatric or mental illness
- harassment
- safe for work
- porn
- self-harm
- violence



### How to use

```python
from classifier import MistralForSequenceClassification
model = MistralForSequenceClassification.from_pretrained('malaysia-ai/malaysian-sfw-classifier')
```


```
                               precision    recall  f1-score   support

                       racist    0.85034   0.90307   0.87591      1661
              religion insult    0.86809   0.85966   0.86386      3399
psychiatric or mental illness    0.94707   0.84181   0.89134      5803
                       sexist    0.80637   0.78992   0.79806      1666
                   harassment    0.83653   0.88663   0.86085       935
                         porn    0.96709   0.95341   0.96020      1202
                safe for work    0.80132   0.91232   0.85322      3205
                    self-harm    0.85751   0.90934   0.88267       364
                     violence    0.77521   0.84049   0.80653      1235

                     accuracy                        0.86754     19470
                    macro avg    0.85661   0.87741   0.86585     19470
                 weighted avg    0.87235   0.86754   0.86822     19470

```