Create README.md with model details
Browse files
README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ko
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: monologg/koelectra-base-v3-discriminator
|
| 6 |
+
tags:
|
| 7 |
+
- ner
|
| 8 |
+
- token-classification
|
| 9 |
+
- pii-detection
|
| 10 |
+
- generated_from_trainer
|
| 11 |
+
- koelectra
|
| 12 |
+
pipeline_tag: token-classification
|
| 13 |
+
library_name: transformers
|
| 14 |
+
metrics:
|
| 15 |
+
- f1
|
| 16 |
+
- precision
|
| 17 |
+
- recall
|
| 18 |
+
widget:
|
| 19 |
+
- text: "제 이름은 홍길동이고, 주민등록번호는 900101-1234567입니다."
|
| 20 |
+
example_title: "PII Example 1"
|
| 21 |
+
- text: "문의사항은 help@example.com으로 연락주세요."
|
| 22 |
+
example_title: "PII Example 2"
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# KoELECTRA for PII Detection (Korean)
|
| 26 |
+
|
| 27 |
+
This model is a fine-tuned version of [monologg/koelectra-base-v3-discriminator](https://huggingface.co/monologg/koelectra-base-v3-discriminator) for **Personally Identifiable Information (PII) Detection** in Korean text.
|
| 28 |
+
|
| 29 |
+
## Model Description
|
| 30 |
+
이 모델은 한국어 텍스트 내에서 개인정보(이름, 주민등록번호, 전화번호, 이메일 등)를 식별하기 위해 KoELECTRA를 기반으로 미세조정(Fine-tuning)되었습니다.
|
| 31 |
+
|
| 32 |
+
- **Developed by:** ParkJunSeong
|
| 33 |
+
- **Shared by:** ParkJunSeong
|
| 34 |
+
- **Language(s):** Korean
|
| 35 |
+
- **License:** Apache-2.0
|
| 36 |
+
- **Base model:** monologg/koelectra-base-v3-discriminator
|
| 37 |
+
- **Task:** Token Classification (NER)
|
| 38 |
+
|
| 39 |
+
## Intended Uses
|
| 40 |
+
이 모델은 다음과 같은 6가지 개인정보 엔티티를 탐지하는 데 사용할 수 있습니다.
|
| 41 |
+
|
| 42 |
+
| Label | Description | Example |
|
| 43 |
+
| :--- | :--- | :--- |
|
| 44 |
+
| **PER** | 이름 (Person) | 홍길동 |
|
| 45 |
+
| **RRN** | 주민등록번호 (Resident Registration Number) | 900101-1234567 |
|
| 46 |
+
| **TEL** | 전화번호 (Phone Number) | 010-1234-5678 |
|
| 47 |
+
| **EMAIL** | 이메일 (Email Address) | example@email.com |
|
| 48 |
+
| **LOC** | 주소 (Location/Address) | 서울시 강남구 |
|
| 49 |
+
| **ORG** | 기관명 (Organization) | 한국통신 |
|
| 50 |
+
|
| 51 |
+
## Evaluation Results
|
| 52 |
+
*(만약 성능 지표가 있다면 이 부분을 채워주세요, 없다면 생략 가능합니다)*
|
| 53 |
+
- **F1 Score:** 9x.xx
|
| 54 |
+
- **Precision:** 9x.xx
|
| 55 |
+
- **Recall:** 9x.xx
|
| 56 |
+
|
| 57 |
+
## Usage
|
| 58 |
+
```python
|
| 59 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
| 60 |
+
|
| 61 |
+
# 1. Load Model & Tokenizer
|
| 62 |
+
model_name = "ParkJunSeong/PIILOT_NER_Model"
|
| 63 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 64 |
+
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 65 |
+
|
| 66 |
+
# 2. Create Inference Pipeline
|
| 67 |
+
# aggregation_strategy="simple" merges tokens (e.g., "홍", "##길동" -> "홍길동")
|
| 68 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
|
| 69 |
+
|
| 70 |
+
# 3. Run Inference
|
| 71 |
+
text = "제 이름은 홍길동이고, 전화번호는 010-1234-5678입니다."
|
| 72 |
+
results = nlp(text)
|
| 73 |
+
|
| 74 |
+
# 4. Check Results
|
| 75 |
+
for entity in results:
|
| 76 |
+
print(f"Entity: {entity['word']}, Label: {entity['entity_group']}, Score: {entity['score']:.4f}")
|