한국어 텍스트에서 개인정보(이름, 전화번호, 지명, 이메일 등)를 자동으로 탐지하고 마스킹하는 FastAPI 서버입니다.
- ✅ 일반 전화번호 필터링 (010-1234-5678)
- ✅ 한글 전화번호 필터링 (공일공-구삼육팔-일팔삼이)
- ✅ 혼합 전화번호 필터링 (공1공-1234-5678)
- ✅ 이메일 필터링
- ✅ 이름, 지명, 조직명 필터링 (NER 모델 기반)
pip install -r requirements.txtpip install -e .python main.py또는
uvicorn main:app --reload브라우저에서 접속:
http://localhost:8000/docs
curl -X POST "http://localhost:8000/filter" \
-H "Content-Type: application/json" \
-d '{
"text": "저는 김철수입니다. 연락처는 공일공-구삼육팔-일팔삼이입니다."
}'import requests
response = requests.post(
"http://localhost:8000/filter",
json={"text": "저는 김철수입니다. 010-1234-5678로 연락주세요."}
)
print(response.json()){
"original_text": "저는 김철수입니다. 공일공-구삼육팔-일팔삼이로 연락주세요.",
"filtered_text": "저는 000입니다. 000-0000-0000로 연락주세요.",
"detected_entities": [
{
"text": "김철수",
"type": "이름",
"start": 4,
"end": 7,
"score": 0.998
},
{
"text": "공일공-구삼육팔-일팔삼이",
"type": "전화번호(한글)",
"start": 13,
"end": 27
}
]
}- NER 모델: Leo97/KoELECTRA-small-v3-modu-ner
- 패턴 매칭: 정규표현식 기반
MIT License