File size: 1,297 Bytes
00c580a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41c1a76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00c580a
41c1a76
 
e8f1c5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
language:
- ko
base_model:
- beomi/kcbert-base
pipeline_tag: token-classification
tags:
- Korean
- PII
- KoreanPII
- PIIMasking
- Anonymization
- Privacy
---

# Korean-PII-Masking-BERT  

**GitHub Repository**: [alphagyuu/Korean-PII-Masking-BERT](https://github.com/alphagyuu/Korean-PII-Masking-BERT)  

Korean-PII-Masking-BERT is a token classification model fine-tuned on KcBERT’s **TokenClassifier** using a processed version of "Korean SNS" dataset from **AI-Hub**. 

## 🖥️ Python Implementation  
- **Tokenizer**:  
  ```python
  BertTokenizer.from_pretrained('beomi/kcbert-base', do_lower_case=False)
  ```
- **Model**:  
  ```python
  TFBertForTokenClassification.from_pretrained('alphagyuu/Korean-PII-Masking-BertForTokenClassification', num_labels=len(tag2idx))
  ```



- **LabelMap**:
  ```python
  LabelMAP = {
    'O': 'LABEL0',
    'B-URL': 'LABEL1',
    'I-URL': 'LABEL2',
    'B-계정': 'LABEL3',
    'I-계정': 'LABEL4',
    'B-금융': 'LABEL5',
    'I-금융': 'LABEL6',
    'B-번호': 'LABEL7',
    'I-번호': 'LABEL8',
    'B-소속': 'LABEL9',
    'I-소속': 'LABEL10',
    'B-신원': 'LABEL11',
    'I-신원': 'LABEL12',
    'B-이름': 'LABEL13',
    'I-이름': 'LABEL14',
    'B-주소': 'LABEL15',
    'I-주소': 'LABEL16'
}
  ```