File size: 1,796 Bytes
717480f
a9bed31
 
4196e78
717480f
 
8e0a50f
717480f
8e0a50f
717480f
8d9ce9f
 
 
 
 
 
 
717480f
97d4402
 
04609a3
 
 
 
 
 
 
 
 
 
 
97d4402
 
 
 
 
 
 
 
 
 
 
8b45da8
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
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



### How to use

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


```
                                precision    recall  f1-score   support

                       racist    0.88481   0.91264   0.89851      1717
              religion insult    0.86248   0.86753   0.86500      3246
psychiatric or mental illness    0.92863   0.83983   0.88200      5825
                       sexist    0.76152   0.74819   0.75480      1656
                   harassment    0.59621   0.86080   0.70448      1717
                         porn    0.96332   0.97697   0.97010      1129
                safe for work    0.90178   0.83741   0.86840      3881
                    self-harm    0.89489   0.92647   0.91040       340

                     accuracy                        0.85388     19511
                    macro avg    0.84920   0.87123   0.85671     19511
                 weighted avg    0.86641   0.85388   0.85709     19511

```